feat(editor): Add helix match selection - #1188
Draft
glcraft wants to merge 22 commits into
Draft
Conversation
glcraft
marked this pull request as draft
August 24, 2026 21:36
Contributor
|
Hey @glcraft! Good to see you around. Thanks! |
It was just for me, I noticed something and had to issue it
…1194) The note asked for it to fold onto a char-class boundary predicate like `Word` and `LongWord`. It cannot: keeping `can't` and `3.14` whole turns on what flanks the `'` or the `.`, which is context rather than class, thus UAX-29 segmentation stays its own scan.
Remove CutInsidePair, CutAroundPair, CopyInsidePair, CopyAroundPair and replace them by CutTextObject, CopyTextObject. Also clean the vi mode implementation to remove action inside/around pair
Author
|
I updated the first comment |
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.
Summary
Add match actions from helix to reedline, and bind the new behaviors to the helix mode.
Keybindings:
mi<TextObject>: select inside a text objectma<TextObject>: select around a text objectms<TextObject>: add the specified text object around the selectionmd<TextObject>: remove the nearest specified text object around the selectionmr<old TextObject><new TextObject>: replace the nearest specified text object around the cursor with another text objectThis includes the following new EditCommand:
SelectTextObjectAddTextObjectRemoveTextObjectReplaceTextObjectMoreover, brackets and quotes are more granular in TextObjectType by differentiating each text object.
Additional notes
Redundant code has been removed, replaced by existing or new functions. In a nutshell,
<Cut/Copy><Inside/Around>Pairhad been replaced by<Cut/Copy>TextObject.Detail here
Among that, the following EditCommand has been replaced:
EditCommand::CutInsidePair{start: char, end: char)=>EditCommand::CutTextObject{scope: TextObjectScope::Inner, object_type: TextObjectType::XXX}EditCommand::CutAroundPair{start: char, end: char)=>EditCommand::CutTextObject{scope: TextObjectScope::Around, object_type: TextObjectType::XXX}EditCommand::CopyInsidePair{start: char, end: char)=>EditCommand::CopyTextObject{scope: TextObjectScope::Inner, object_type: TextObjectType::XXX}EditCommand::CopyAroundPair{start: char, end: char)=>EditCommand::CopyTextObject{scope: TextObjectScope::Around, object_type: TextObjectType::XXX}In
core_editor::editor::Editor, the following functions have been replaced:cut_inside_pair=>cut_text_objectcut_around_pair=>cut_text_objectcopy_inside_pair=>copy_text_objectcopy_around_pair=>copy_text_objectVi mode implementation has been updated towards that.
All tests passes.