diff options
| author | nyamatongwe <unknown> | 2013-03-07 12:39:44 +1100 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2013-03-07 12:39:44 +1100 | 
| commit | ded6ea3c133c7c591bc82670a4e1e4174fca033f (patch) | |
| tree | bae6b2915c6c0a5e1983af4c1e5b2d7dc652c293 /lexers/LexCPP.cxx | |
| parent | c6d4cd5d9f42251c20cfc9c80ac80389a39abfbe (diff) | |
| download | scintilla-mirror-ded6ea3c133c7c591bc82670a4e1e4174fca033f.tar.gz | |
Bug: [#482]. Refix to make /// comment not affect folding of following /* comment.
Diffstat (limited to 'lexers/LexCPP.cxx')
| -rw-r--r-- | lexers/LexCPP.cxx | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index a064328c8..4f3b4f509 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -1041,6 +1041,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,  	unsigned int endPos = startPos + length;  	int visibleChars = 0; +	bool inLineComment = false;  	int lineCurrent = styler.GetLine(startPos);  	int levelCurrent = SC_FOLDLEVELBASE;  	if (lineCurrent > 0) @@ -1059,10 +1060,12 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,  		style = styleNext;  		styleNext = MaskActive(styler.StyleAt(i + 1));  		bool atEOL = i == (lineStartNext-1); -		if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style)) { -			if (!IsStreamCommentStyle(stylePrev) && (stylePrev != SCE_C_COMMENTLINEDOC)) { +		if ((style == SCE_C_COMMENTLINE) || (style == SCE_C_COMMENTLINEDOC)) +			inLineComment = true; +		if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) { +			if (!IsStreamCommentStyle(stylePrev)) {  				levelNext++; -			} else if (!IsStreamCommentStyle(styleNext) && (styleNext != SCE_C_COMMENTLINEDOC) && !atEOL) { +			} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {  				// Comments don't end at end of line and the next character may be unstyled.  				levelNext--;  			} @@ -1134,6 +1137,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,  				styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);  			}  			visibleChars = 0; +			inLineComment = false;  		}  	}  } | 
