diff options
Diffstat (limited to 'lexers/LexVHDL.cxx')
-rw-r--r-- | lexers/LexVHDL.cxx | 7 |
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' || |