Skip to content

Commit 0836ff5

Browse files
Brian Taboneclaude
andcommitted
fix: use SCI_GOTOPOS(matchPos) for upstream parity in Go to Matching Brace
Switch from matchPos+1 to matchPos to match upstream Notepad++ behavior (NppCommands.cpp IDM_SEARCH_GOTOMATCHINGBRACE). Also add SCI_CHOOSECARETX after the jump to stabilize subsequent Up/Down column navigation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 55b6545 commit 0836ff5

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

macos/platform/brace_match.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ void doGoToMatchingBrace(void* sci)
7676
{
7777
intptr_t matchPos = ScintillaBridge_sendMessage(sci, SCI_BRACEMATCH, bracePos, 0);
7878
if (matchPos >= 0)
79-
ScintillaBridge_sendMessage(sci, SCI_GOTOPOS, matchPos + 1, 0);
79+
{
80+
ScintillaBridge_sendMessage(sci, SCI_GOTOPOS, matchPos, 0);
81+
ScintillaBridge_sendMessage(sci, SCI_CHOOSECARETX, 0, 0);
82+
}
8083
}
8184
}
8285

macos/platform/npp_constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ enum {
288288
SCI_BRACEHIGHLIGHT = 2351,
289289
SCI_BRACEBADLIGHT = 2352,
290290
SCI_BRACEMATCH = 2353,
291+
SCI_CHOOSECARETX = 2399,
291292

292293
// Indentation queries
293294
SCI_GETUSETABS = 2125,

0 commit comments

Comments
 (0)