From f5524ed07ac6f093cdccd729fc440f12936827f5 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 2 Aug 2010 14:50:37 +1000 Subject: Moved line state one line earlier so it refers to the state at the end of the line. This makes it more robust when lines are inserted or removed as occurred in bug #3032652. --- lexers/LexHTML.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx index 6aa2e13bc..0d54e7a3e 100644 --- a/lexers/LexHTML.cxx +++ b/lexers/LexHTML.cxx @@ -615,7 +615,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty int lineCurrent = styler.GetLine(startPos); int lineState; if (lineCurrent > 0) { - lineState = styler.GetLineState(lineCurrent); + lineState = styler.GetLineState(lineCurrent-1); } else { // Default client and ASP scripting language is JavaScript lineState = eScriptJS << 8; @@ -798,8 +798,6 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty visibleChars = 0; levelPrev = levelCurrent; } - lineCurrent++; - lineStartVisibleChars = 0; styler.SetLineState(lineCurrent, ((inScriptType & 0x03) << 0) | ((tagOpened & 0x01) << 2) | @@ -807,6 +805,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty ((aspScript & 0x0F) << 4) | ((clientScript & 0x0F) << 8) | ((beforePreProc & 0xFF) << 12)); + lineCurrent++; + lineStartVisibleChars = 0; } // Allow falling through to mako handling code if newline is going to end a block -- cgit v1.2.3