diff options
author | Neil <nyamatongwe@gmail.com> | 2014-06-02 09:31:48 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-06-02 09:31:48 +1000 |
commit | 696d4aae75bf605ad5d5196267f851a26d834e52 (patch) | |
tree | 207b02fb2b7bf92c7ee8a47e331c8ad21a8376b8 /lexers/LexBash.cxx | |
parent | 3f4777904cbe80d0bdb024215426d9e45377902a (diff) | |
download | scintilla-mirror-696d4aae75bf605ad5d5196267f851a26d834e52.tar.gz |
Bug [#1605]. Fix fold matching problem caused by "<<<".
From Kein-Hong Man.
Diffstat (limited to 'lexers/LexBash.cxx')
-rw-r--r-- | lexers/LexBash.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lexers/LexBash.cxx b/lexers/LexBash.cxx index b85d01a7d..3ebba8911 100644 --- a/lexers/LexBash.cxx +++ b/lexers/LexBash.cxx @@ -767,6 +767,7 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[], bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; + int skipHereCh = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; @@ -798,7 +799,15 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[], // Here Document folding if (style == SCE_SH_HERE_DELIM) { if (ch == '<' && chNext == '<') { - levelCurrent++; + if (styler.SafeGetCharAt(i + 2) == '<') { + skipHereCh = 1; + } else { + if (skipHereCh == 0) { + levelCurrent++; + } else { + skipHereCh = 0; + } + } } } else if (style == SCE_SH_HERE_Q && styler.StyleAt(i+1) == SCE_SH_DEFAULT) { levelCurrent--; |