diff options
| author | Joe Mueller <devnull@localhost> | 2015-01-29 07:57:52 -0800 |
|---|---|---|
| committer | Joe Mueller <devnull@localhost> | 2015-01-29 07:57:52 -0800 |
| commit | 0cc39d5db20b689b67d849b9208feb2a255d4cc1 (patch) | |
| tree | 88e8ebfdb2082d22c2eab279615b392df462fc14 | |
| parent | 88adc2ee0388c857a512275a6995dc227d30e408 (diff) | |
| download | scintilla-mirror-0cc39d5db20b689b67d849b9208feb2a255d4cc1.tar.gz | |
fix problem with folding comments by re-folding the previous line as was done in LexerModule::Fold
| -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; |
