From 5fd799e2b48e30fb560b219f684a8656af779672 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 22 Nov 2010 19:01:03 +0000 Subject: fixed some exceptions in syntax highlighter git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5167 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/editor/scripteditor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/modules/editor/scripteditor.cpp') diff --git a/src/modules/editor/scripteditor.cpp b/src/modules/editor/scripteditor.cpp index 86ab06632..10e911bcf 100644 --- a/src/modules/editor/scripteditor.cpp +++ b/src/modules/editor/scripteditor.cpp @@ -633,9 +633,13 @@ void KviScriptEditorSyntaxHighlighter::updateSyntaxtTextFormat() void KviScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) { if(szText.isEmpty()) + { + setCurrentBlockState(previousBlockState()); return; + } int iIndexStart=0; + setCurrentBlockState(0); if(previousBlockState() == 1) { @@ -652,7 +656,6 @@ void KviScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) iCommentEnd+=2; // end of comment found setFormat(iIndexStart,iCommentEnd - iIndexStart,commentFormat); - setCurrentBlockState(0); iIndexStart = iCommentEnd; } @@ -693,7 +696,7 @@ void KviScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) setCurrentBlockState(1); while(iIndexStart