public void ShowMatchingBrace(bool beforeAndAfterCursor, bool alignIndentation)
{
int currentPos = scintillaControl1.CurrentPos - 1;
int matchPos = scintillaControl1.BraceMatch(currentPos);
if ((matchPos < 0) && (beforeAndAfterCursor))
{
// try the following character instead
currentPos++;
matchPos = scintillaControl1.BraceMatch(currentPos);
}
if (matchPos >= 0)
{
if (alignIndentation)
{
AlignIndentation(currentPos, matchPos);
currentPos = scintillaControl1.CurrentPos - 1;
}
scintillaControl1.BraceHighlight(matchPos, currentPos);
}
else
{
scintillaControl1.BraceBadLight(currentPos);
}
_braceMatchVisible = true;
_doBraceMatch = false;
}