Repository navigation
Find panel: Replace, Find next from the caret, Selection scope (#1164, #1165, #1166) - #1176
Merged
Merged
Conversation
…#1165, #1166) Replace replaced the match at the caret even when nothing was selected, so a replacement that is itself a match was replaced again (#1164). It now replaces only a selected match; without one it selects the next match first. Replace and Replace all leave the caret after the replacement with nothing selected. Without a selected match, Find next went on from a match that ended at the caret, skipping it (#1165). It now takes the first match that ends after the caret, and Find prev the last one that starts before it. The highlighted current match follows the search direction. The Selection option used the current selection at each operation, so the first Find next narrowed the search to the match it selected (#1166). The selection when the option is turned on is now the scope. Replacements on its last line move its end, and replacing all of its text leaves an empty scope with no matches. Other changes of the text (typing, undo, new content) drop the scope and turn the option off; the operation that notices it does nothing that time. The option needs a selection. Reopening the panel (F3 after Esc) takes a new selection as the scope, but not the match the panel selected. In both cases the find text is kept; it no longer takes the case of the found match. The editor highlights only matches in the scope, and none after the text changes until the panel sets the highlight again. EditableContent.revision identifies the state of the text. It changes with each edit, undo, redo, new content and clear(), and differs between content objects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
buggins
marked this pull request as ready for review
November 24, 2026 12:52
This was referenced Nov 24, 2026
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.
Fixes #1164, fixes #1165, fixes #1166.
Replace (#1164)
id→xid) was replaced again on every click.Find next from the caret (#1165)
Selection option (#1166)
API
EditableContent.revision: a new value with each edit, undo, redo, new content andclear(), never shared between content objects (atomic counter).EditWidgetBase.setTextToHighlight(pattern, options, scope_, back), a new overload. The two-argument form is unchanged (DlangIDE uses it).WHOLE_TEXT_RANGE;EditBox.currentMatchIndex()gets an optionalbackparameter;EditBox.forEachLineMatch()(the overload withcurrent) takes a scope and the direction.findNextPattern(): a single selected match returns true with the position unchanged. A caret right after a match goes on to the next one.Testing
dub test(Linux and Windows) anddub test -c console: pass, no leak lines. D-Scanner: clean.matchesInScope,scopeAfterReplaceandrevision.The highlighted current match is still found on the caret line only, while Find next can go to the next line: #1177.
🤖 Generated with Claude Code