Repository navigation
Keep incremental search "Highlight all" up to date - #18490
Open
LucaSorvillo wants to merge 1 commit into
Open
LucaSorvillo wants to merge 1 commit into
LucaSorvillo wants to merge 1 commit into
Conversation
With "Highlight all" checked, the matches of the text of the incremental search bar are highlighted again when another document is activated, after the document is edited (300 ms after the last change) and when the bar is shown again. When the bar is hidden, an activated document loses the highlighting left by an earlier search. Like Smart Highlighting, large files are not highlighted automatically. Fix notepad-plus-plus#18489 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With "Highlight all" checked, the incremental search bar now keeps its highlighting up to date:
FindIncrementDlg::refreshHighlightAll()highlights the matches of the text of the bar in the current document. It uses the text of the bar, not the selection likemarkSelectedTextInc(), because after a tab switch or an edit the selection may be anything;Notepad_plus::notifyBufferActivated()(tab or view switch), byIDM_SEARCH_FINDINCREMENTwhen the bar is shown again with nothing selected, and 300 ms after the last edit of the document (refreshHighlightAllLater(): a timer of the bar, started fromSCN_MODIFIEDwhere the count is already reset);Searching from the bar works as before (the typed text, "Match case", the arrows...).
Tested on Windows 11 with a Release x64 build of this branch (0 warnings), with an automated GUI test (Win32 messages, separate settings folder): typed text highlighted as before; switching to another document and back; a new match typed in the document highlighted after the delay; "Match case" toggled; bar closed: the current and the other document left without highlighting; bar shown again with nothing selected; large file with the restriction: not highlighted.
AI disclosure: the code and this description were written with Claude Code (Claude Opus 5.5); the build and the tests above were run on a real Windows 11 machine.
fix #18489
🤖 Generated with Claude Code