diff options
| author | Jim Pattee <unknown> | 2017-04-10 08:14:34 +1000 | 
|---|---|---|
| committer | Jim Pattee <unknown> | 2017-04-10 08:14:34 +1000 | 
| commit | fc7ac54d5936008e1e2db8f490ae105e4acebfbb (patch) | |
| tree | fd5fcdecbb3f312b03eb5d6425f83b5b1f97504d | |
| parent | da34a05d99e324ffc3ca802ca9d65db2a4e7eac9 (diff) | |
| download | scintilla-mirror-fc7ac54d5936008e1e2db8f490ae105e4acebfbb.tar.gz | |
Bug [#1931]. Recognize comments in more situations and treat "..." like "---".
| -rw-r--r-- | doc/ScintillaHistory.html | 5 | ||||
| -rw-r--r-- | lexers/LexYAML.cxx | 6 | 
2 files changed, 10 insertions, 1 deletions
| diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 7caf33425..0cca9f7a0 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -543,6 +543,11 @@  	The Python lexer recognizes identifiers more accurately when they include non-ASCII characters.  	</li>  	<li> +	The YAML lexer recognizes comments in more situations and styles a +	"..." line like a "---" line. +	<a href="http://sourceforge.net/p/scintilla/bugs/1931/">Bug #1931</a>. +	</li> +	<li>  	On Cocoa, the autocompletion is 4 pixels wider to avoid text truncation.  	</li>  	<li> diff --git a/lexers/LexYAML.cxx b/lexers/LexYAML.cxx index 9f28bb843..3709538b7 100644 --- a/lexers/LexYAML.cxx +++ b/lexers/LexYAML.cxx @@ -98,7 +98,7 @@ static void ColouriseYAMLLine(  		}  	}  	styler.SetLineState(currentLine, 0); -	if (strncmp(lineBuffer, "---", 3) == 0) {	// Document marker +	if (strncmp(lineBuffer, "---", 3) == 0 || strncmp(lineBuffer, "...", 3) == 0) {	// Document marker  		styler.SetLineState(currentLine, YAML_STATE_DOCUMENT);  		styler.ColourTo(endPos, SCE_YAML_DOCUMENT);  		return; @@ -119,6 +119,10 @@ static void ColouriseYAMLLine(  	while (i < lengthLine) {  		if (lineBuffer[i] == '\'' || lineBuffer[i] == '\"') {  			bInQuotes = !bInQuotes; +		} else if (lineBuffer[i] == '#' && isspacechar(lineBuffer[i - 1]) && !bInQuotes) { +			styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT); +			styler.ColourTo(endPos, SCE_YAML_COMMENT); +			return;  		} else if (lineBuffer[i] == ':' && !bInQuotes) {  			styler.ColourTo(startLine + i - 1, SCE_YAML_IDENTIFIER);  			styler.ColourTo(startLine + i, SCE_YAML_OPERATOR); | 
