From 2e4572c276d0b07fe25437b7264eed90991aab80 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Feb 2015 12:53:34 +1100 Subject: Fix hang in folding when document starts with "entity". From Vicente. --- doc/ScintillaHistory.html | 3 +++ lexers/LexVHDL.cxx | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index d3d270ce9..c7e5fbed8 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -502,6 +502,9 @@ Verilog folder fixes a bug with inconsistent folding when fold.comment is on.
  • + VHDL folder fixes hang in folding when document starts with "entity". +
  • +
  • Add new indicators INDIC_COMPOSITIONTHIN and INDIC_FULLBOX. INDIC_COMPOSITIONTHIN is a thin underline that mimics the appearance of non-target segments in OS X IME. INDIC_FULLBOX is similar to INDIC_STRAIGHTBOX but covers the entire character area which means that 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' || -- cgit v1.2.3