Skip to content

Conversation

JonLD
Copy link
Contributor

@JonLD JonLD commented Oct 4, 2025

Make the TextObject, TextObjectScope and TextObjectType types public. This enables the EditCommands for these to be used in Nushell for setting keybindings.
Additionally, fix the EditType of CopyInsidePair and CopyAroundPair to NoOp.

@JonLD JonLD force-pushed the feature/text-object-types-public branch from 6ed01aa to 3fad26f Compare October 4, 2025 18:05
@JonLD
Copy link
Contributor Author

JonLD commented Oct 4, 2025

@fdncred this makes the text object types public necessary for adding the text object EditCommands to Nushell. See nushell/nushell#16808 for the associated Nushell changes to support textobjects.

@fdncred fdncred merged commit 32e82c2 into nushell:main Oct 6, 2025
5 of 6 checks passed
@fdncred
Copy link
Contributor

fdncred commented Oct 6, 2025

Thanks

fdncred added a commit to nushell/nushell that referenced this pull request Oct 6, 2025
This PR updates nushell to the latest reedline commit 32e82c27.

Notes from @JonLD regarding reedline's new `TextObject`, reedline change
author of nushell/reedline#939 and
nushell/reedline#957 and #16808

Since EditCommand contains a TextObject and not a string it is not
possible for the user to directly there needs to be a bit of work done
to construct the relevant text object. Maintains the edit command names,
seen under "keybindings list", of CutTextObject and CopyTextObject and
using scope: <inner|around> and the object_type: mirrors the Reedline
implementation and the informative error messages should help signal to
users what are valid inputs. Ideally the "keybindings list" would be a
bit mor informative as to how to set up specific keybindings but that's
not currently possible, and perhaps not even necessary.
The alternative would be to set up edit commands for each text object,
this would be a larger Reedline change and add unecessary complexity to
Reedline but would expose the commands better to the use. You could just
add them in this file and keep Reedline as is but that would not be
exposed to the user via "keybindings list" as this command lists the
actual enums and not commands set up in the reedline_config.rs.

## Release notes summary - What our users need to know
Breaking change since the reedline change renames `cutinside` and
`yankinside`. The PR adds these new EditCommands:
- cutinsidepair
- copyinsidepair
- cutaroundpair
- copyaroundpair
- cuttextobject
- copytextobject

## Tasks after submitting
N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants