private void CloseBracket(TextEditor.TextEditor editor, TextDocument document, string text)
{
if (text[0].IsCloseBracketChar() && editor.CaretIndex < document.TextLength && editor.CaretIndex > 0)
{
if (document.GetCharAt(editor.CaretIndex) == text[0])
{
document.Replace(editor.CaretIndex - 1, 1, string.Empty);
}
}
}