Clear error indicators when there is no error
This commit is contained in:
parent
70292fe84a
commit
bc99b579db
|
@ -3354,6 +3354,7 @@ bool MyFrame::openFile ( wxString& fileName, bool largeFile )
|
||||||
int newPosition = doc->PositionFromLine ( posPair.first );
|
int newPosition = doc->PositionFromLine ( posPair.first );
|
||||||
doc->SetSelection ( newPosition, newPosition );
|
doc->SetSelection ( newPosition, newPosition );
|
||||||
doc->SetFocus();
|
doc->SetFocus();
|
||||||
|
doc->setErrorIndicator ( posPair.first, posPair.second );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1999,15 +1999,16 @@ std::string XmlCtrl::myGetTextRaw()
|
||||||
|
|
||||||
void XmlCtrl::setErrorIndicator ( int line, int column )
|
void XmlCtrl::setErrorIndicator ( int line, int column )
|
||||||
{
|
{
|
||||||
int startPos, endPos;
|
int startPos, endPos, endStyled;
|
||||||
startPos = PositionFromLine ( line ) + column;
|
startPos = PositionFromLine ( line ) + column;
|
||||||
endPos = GetLineEndPosition ( line );
|
endPos = GetLineEndPosition ( line );
|
||||||
StartStyling ( startPos, wxSTC_INDIC2_MASK );
|
endStyled = GetEndStyled();
|
||||||
|
if ( endPos > endStyled ) endPos = endStyled;
|
||||||
|
|
||||||
int length = endPos - startPos;
|
int length = endPos - startPos;
|
||||||
|
if ( length > 0 && length + startPos < GetLength() )
|
||||||
if ( length == 0 || ( length > 0 && length + startPos < GetLength() ) )
|
|
||||||
{
|
{
|
||||||
|
StartStyling ( startPos, wxSTC_INDIC2_MASK );
|
||||||
SetStyling ( length, wxSTC_INDIC2_MASK );
|
SetStyling ( length, wxSTC_INDIC2_MASK );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2021,11 +2022,11 @@ void XmlCtrl::clearErrorIndicators ( int maxLine )
|
||||||
if ( !length )
|
if ( !length )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
StartStyling ( 0, wxSTC_INDIC2_MASK );
|
|
||||||
|
|
||||||
int end = GetEndStyled();
|
int end = GetEndStyled();
|
||||||
length = ( maxLine ) ? GetLineEndPosition ( maxLine ) : length;
|
length = ( maxLine ) ? GetLineEndPosition ( maxLine ) : length;
|
||||||
if ( length > end ) length = end;
|
if ( end > 0 && length > end ) length = end;
|
||||||
|
|
||||||
|
StartStyling ( 0, wxSTC_INDIC2_MASK );
|
||||||
SetStyling ( length, 0 );
|
SetStyling ( length, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue