aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexVHDL.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2015-02-10 12:53:34 +1100
committerNeil <nyamatongwe@gmail.com>2015-02-10 12:53:34 +1100
commit3bc8aa826c28d91b5e5cf248234a0db09f7b07a6 (patch)
treebd75c53c43f952f28a1ea9fcbedd669e2bf8e274 /lexers/LexVHDL.cxx
parenteeed33bc79f4c3532ae8f504060db8947520da87 (diff)
downloadscintilla-mirror-3bc8aa826c28d91b5e5cf248234a0db09f7b07a6.tar.gz
Fix hang in folding when document starts with "entity".
From Vicente.
Diffstat (limited to 'lexers/LexVHDL.cxx')
-rw-r--r--lexers/LexVHDL.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/lexers/LexVHDL.cxx b/lexers/LexVHDL.cxx
index fe1b33317..474726c8f 100644
--- a/lexers/LexVHDL.cxx
+++ b/lexers/LexVHDL.cxx
@@ -388,13 +388,14 @@ static void FoldNoBoxVHDLDoc(
strcmp(s, "entity") == 0 ||
strcmp(s, "configuration") == 0 )
{
- if (strcmp(prevWord, "end") != 0)
+ if (strcmp(prevWord, "end") != 0 && lastStart)
{ // check for instantiated unit by backward searching for the colon.
- unsigned pos = lastStart-1;
+ unsigned pos = lastStart;
char chAtPos, styleAtPos;
do{// skip white spaces
+ pos--;
styleAtPos = styler.StyleAt(pos);
- chAtPos = styler.SafeGetCharAt(pos--);
+ chAtPos = styler.SafeGetCharAt(pos);
}while(pos>0 &&
(chAtPos == ' ' || chAtPos == '\t' ||
chAtPos == '\n' || chAtPos == '\r' ||