From a67a5f71706777a5fc7e06870404de7a98967614 Mon Sep 17 00:00:00 2001 From: Alan Kilborn Date: Wed, 29 Mar 2023 08:22:07 -0400 Subject: [PATCH] Fix unexpected column jump post brace match Fix #13433, close #13441 --- PowerEditor/src/NppCommands.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 6db1dd316..09a63fb0b 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -1654,6 +1654,11 @@ void Notepad_plus::command(int id) _pEditView->execute(SCI_GOTOPOS, braceOpposite); else _pEditView->execute(SCI_SETSEL, std::min(braceAtCaret, braceOpposite), std::max(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;