diff options
author | nyamatongwe <unknown> | 2007-07-05 11:54:23 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2007-07-05 11:54:23 +0000 |
commit | 04373baec99f83ed6855f99eea4b5827619e8cfb (patch) | |
tree | 0ea69e465236e4d47792e2c483c1bf077666acf5 | |
parent | 24e860a1eb574e3e3235c0f42d5ca57e871b2796 (diff) | |
download | scintilla-mirror-04373baec99f83ed6855f99eea4b5827619e8cfb.tar.gz |
lexer.errorlist.value.separate styles location and matched text separately
for Find in Files command.
-rw-r--r-- | include/SciLexer.h | 1 | ||||
-rw-r--r-- | include/Scintilla.iface | 1 | ||||
-rw-r--r-- | src/LexOthers.cxx | 20 |
3 files changed, 17 insertions, 5 deletions
diff --git a/include/SciLexer.h b/include/SciLexer.h index de717c4eb..85fdfe36f 100644 --- a/include/SciLexer.h +++ b/include/SciLexer.h @@ -422,6 +422,7 @@ #define SCE_ERR_ABSF 18 #define SCE_ERR_TIDY 19 #define SCE_ERR_JAVA_STACK 20 +#define SCE_ERR_VALUE 21 #define SCE_BAT_DEFAULT 0 #define SCE_BAT_COMMENT 1 #define SCE_BAT_WORD 2 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 2b7a0f1e6..e1f24ebb1 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -2350,6 +2350,7 @@ val SCE_ERR_IFORT=17 val SCE_ERR_ABSF=18 val SCE_ERR_TIDY=19 val SCE_ERR_JAVA_STACK=20 +val SCE_ERR_VALUE=21 # Lexical states for SCLEX_BATCH lex Batch=SCLEX_BATCH SCE_BAT_ val SCE_BAT_DEFAULT=0 diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index c4aca0c08..58aa6f78c 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -818,7 +818,7 @@ static bool strstart(const char *haystack, const char *needle) { return strncmp(haystack, needle, strlen(needle)) == 0; } -static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLine) { +static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLine, int &startValue) { if (lineBuffer[0] == '>') { // Command or return status return SCE_ERR_CMD; @@ -934,6 +934,7 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin } else if (state == stGccDigit) { // <filename>:<line> if (ch == ':') { state = stGcc; // :9.*: is GCC + startValue = i + 1; break; } else if (!Is0To9(ch)) { state = stUnrecognized; @@ -1009,8 +1010,16 @@ static void ColouriseErrorListLine( char *lineBuffer, unsigned int lengthLine, unsigned int endPos, - Accessor &styler) { - styler.ColourTo(endPos, RecogniseErrorListLine(lineBuffer, lengthLine)); + Accessor &styler, + bool valueSeparate) { + int startValue = -1; + int style = RecogniseErrorListLine(lineBuffer, lengthLine, startValue); + if (valueSeparate && (startValue >= 0)) { + styler.ColourTo(endPos - (lengthLine - startValue), style); + styler.ColourTo(endPos, SCE_ERR_VALUE); + } else { + styler.ColourTo(endPos, style); + } } static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { @@ -1018,17 +1027,18 @@ static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordLi styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; + bool valueSeparate = styler.GetPropertyInt("lexer.errorlist.value.separate", 0) != 0; for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; - ColouriseErrorListLine(lineBuffer, linePos, i, styler); + ColouriseErrorListLine(lineBuffer, linePos, i, styler, valueSeparate); linePos = 0; } } if (linePos > 0) { // Last line does not have ending characters - ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler); + ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler, valueSeparate); } } |