From d0b4f550d15907d566ca52b6d5b716df60999bd3 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Thu, 11 Jun 2009 14:25:20 +0000 Subject: [PATCH] Backport fix from Scintilla CVS: Pascal lexer hanging on file that starts with 'interface' after whitespace. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3859 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 8 ++++++++ scintilla/LexPascal.cxx | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07f5a056..4af6db44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-06-11 Nick Treleaven + + * scintilla/LexPascal.cxx: + Backport fix from Scintilla CVS: + Pascal lexer hanging on file that starts with 'interface' after + whitespace. + + 2009-06-11 Enrico Tröger * waf: diff --git a/scintilla/LexPascal.cxx b/scintilla/LexPascal.cxx index 371043d9..3dcf35ad 100644 --- a/scintilla/LexPascal.cxx +++ b/scintilla/LexPascal.cxx @@ -414,7 +414,7 @@ static unsigned int SkipWhiteSpace(unsigned int currentPos, unsigned int endPos, } static void ClassifyPascalWordFoldPoint(int &levelCurrent, int &lineFoldStateCurrent, - unsigned int startPos, unsigned int endPos, + int startPos, unsigned int endPos, unsigned int lastStart, unsigned int currentPos, Accessor &styler) { char s[100]; GetRangeLowered(lastStart, currentPos, styler, s, sizeof(s)); @@ -471,7 +471,7 @@ static void ClassifyPascalWordFoldPoint(int &levelCurrent, int &lineFoldStateCur } else if (strcmp(s, "interface") == 0) { // "interface" keyword requires special handling... bool ignoreKeyword = true; - unsigned int j = lastStart - 1; + int j = lastStart - 1; char ch = styler.SafeGetCharAt(j); while ((j >= startPos) && (IsASpaceOrTab(ch) || ch == '\r' || ch == '\n' || IsStreamCommentStyle(styler.StyleAt(j)))) {