aboutsummaryrefslogtreecommitdiffhomepage
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
commit143463269e71eb6e2b990fd2f8c7c81d90299801 (patch)
tree20c2f9763f50a0b3bcf321f15d212c1c13cbcafe
parenta5263b339614245f28ee94c057ac2fb227ec3d5d (diff)
downloadscintilla-mirror-143463269e71eb6e2b990fd2f8c7c81d90299801.tar.gz
Bug [#1605]. Fix fold matching problem caused by "<<<".
From Kein-Hong Man.
-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--;