editor: Fix add selection when skipping over soft-wrapped lines #46911
+199
−47
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 an issue where
editor::AddSelectionAboveandeditor::AddSelectionBelow, when set withskip_soft_wrap: true,would lose track of the original cursor column when passing through
short lines, as
editor::Editor.add_selectionwas not using the oldestselection's column range when adding a new selection.
These changes update the
editor::Editor.add_selectionmethod so as tokeep track of the olde selection's column range for each group, as well
as extracting
find_next_columnar_selection_by_display_rowandfind_next_columnar_selection_by_buffer_rowhelper methods to clarifythe two navigation strategies.
Closes #46842
Release Notes:
editor::AddSelectionAboveandeditor::AddSelectionBelowwhen skipping over soft-wrapped lines to preserve the original cursor column when adding selections through lines shorter than the starting position