aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexBash.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-06-02 09:31:48 +1000
committerNeil <nyamatongwe@gmail.com>2014-06-02 09:31:48 +1000
commit696d4aae75bf605ad5d5196267f851a26d834e52 (patch)
tree207b02fb2b7bf92c7ee8a47e331c8ad21a8376b8 /lexers/LexBash.cxx
parent3f4777904cbe80d0bdb024215426d9e45377902a (diff)
downloadscintilla-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.cxx11
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--;