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 /src/LexOthers.cxx | |
| parent | 24e860a1eb574e3e3235c0f42d5ca57e871b2796 (diff) | |
| download | scintilla-mirror-04373baec99f83ed6855f99eea4b5827619e8cfb.tar.gz | |
lexer.errorlist.value.separate styles location and matched text separately
for Find in Files command.
Diffstat (limited to 'src/LexOthers.cxx')
| -rw-r--r-- | src/LexOthers.cxx | 20 | 
1 files changed, 15 insertions, 5 deletions
| 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);  	}  } | 
