diff options
author | Joe Mueller <unknown> | 2015-01-29 07:57:52 -0800 |
---|---|---|
committer | Joe Mueller <unknown> | 2015-01-29 07:57:52 -0800 |
commit | 80c7945aff05cb19cc21955324b4e1327ec52764 (patch) | |
tree | 68616a1e27f92152ecd63b597511e9d86270af59 /lexers/LexVerilog.cxx | |
parent | ee7577370df33925cbae02c012584e071a9f4cbb (diff) | |
download | scintilla-mirror-80c7945aff05cb19cc21955324b4e1327ec52764.tar.gz |
fix problem with folding comments by re-folding the previous line as was done in LexerModule::Fold
Diffstat (limited to 'lexers/LexVerilog.cxx')
-rw-r--r-- | lexers/LexVerilog.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lexers/LexVerilog.cxx b/lexers/LexVerilog.cxx index f4e4a8344..fdafbddc3 100644 --- a/lexers/LexVerilog.cxx +++ b/lexers/LexVerilog.cxx @@ -756,9 +756,20 @@ void SCI_METHOD LexerVerilog::Fold(unsigned int startPos, int length, int initSt bool foldAtBrace = 1; bool foldAtParenthese = 1; + int lineCurrent = styler.GetLine(startPos); + // Move back one line to be compatible with LexerModule::Fold behavior, fixes problem with foldComment behavior + if (lineCurrent > 0) { + lineCurrent--; + int newStartPos = styler.LineStart(lineCurrent); + length += startPos - newStartPos; + startPos = newStartPos; + initStyle = 0; + if (startPos > 0) { + initStyle = styler.StyleAt(startPos - 1); + } + } unsigned int endPos = startPos + length; int visibleChars = 0; - int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; |