From e42354ff09418fde12a6616120220b3f958d48a0 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Sat, 8 Sep 2012 20:18:27 +0800 Subject: [PATCH] Bug #3402443 Syntax coloring and folding loosed on big xmls --- src/xmlctrl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/xmlctrl.cpp b/src/xmlctrl.cpp index 13c6cb3..226189d 100755 --- a/src/xmlctrl.cpp +++ b/src/xmlctrl.cpp @@ -2017,14 +2017,15 @@ void XmlCtrl::clearErrorIndicators ( int maxLine ) if ( maxLine < 0 ) return; - int documentLength = GetLength(); - if ( !documentLength ) + int length = GetLength(); + if ( !length ) return; StartStyling ( 0, wxSTC_INDIC2_MASK ); - int length; - length = ( maxLine ) ? GetLineEndPosition ( maxLine ) : documentLength; + int end = GetEndStyled(); + length = ( maxLine ) ? GetLineEndPosition ( maxLine ) : length; + if ( length > end ) length = end; SetStyling ( length, 0 ); }