Fix unexpected column jump post brace match

Fix #13433, close #13441
This commit is contained in:
Alan Kilborn 2023-03-29 08:22:07 -04:00 committed by Don Ho
parent 24d3a69f0f
commit a67a5f7170
1 changed files with 5 additions and 0 deletions

View File

@ -1654,6 +1654,11 @@ void Notepad_plus::command(int id)
_pEditView->execute(SCI_GOTOPOS, braceOpposite);
else
_pEditView->execute(SCI_SETSEL, std::min<intptr_t>(braceAtCaret, braceOpposite), std::max<intptr_t>(braceAtCaret, braceOpposite) + 1); // + 1 so we always include the ending brace in the selection.
// Update Scintilla's knowledge about what column the caret is in, so that if user
// does up/down arrow as first navigation after the brace-match operation,
// the caret doesn't jump to an unexpected column
_pEditView->execute(SCI_CHOOSECARETX);
}
}
break;