Handle more events for until keybindings #876
Labels
A-EditOps
Area: core editing operations (shared between keybindings)
A-KeybindingEmacs
Area: Handling of default (Emacs style) keybindings
A-ViKeybinding
Area: Vi(m) keybinding support
enhancement
New feature or request
Currently,
until
keybindings only work for menu events: all other events will be considered successful and hence the remaining until cases will not be considered.I can think of a number of events that should be considered to have failed at times: e.g.
MoveToLineStart
if the cursor is already at line start,CutSelection
if nothing is selected,BackspaceWord
if there is nothing to remove etc.However, the only event I am personally interested in is
CopySelection
andCopySelectionSystem
(which should reasonably fail if no text is currently selected), since being able to useuntil
for those events would allow for e.g.which in theory should emulate the behavior that many terminal emulators support as an option: Ctrl+c copies text if any text is selected, otherwise it interrupts / clears the line.
Sidenote
The line editor unselects the selected text when
copyselectionsystem
is activated, which seems a bit odd as I am not aware of any other text editor where that is the case.References
The nu documentation mentions that
For the ctrl+c behavior, e.g. the Kitty terminal has the mappable action
copy_or_interrupt
, which the line editor expectedly does not respect since it always receives Ctrl+c from Kitty, as Kitty does not recognize the readline text as selected.The text was updated successfully, but these errors were encountered: