Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New actions to cancel menu & accept-and-hold #767

Open
bew opened this issue Mar 10, 2024 · 0 comments
Open

New actions to cancel menu & accept-and-hold #767

bew opened this issue Mar 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@bew
Copy link
Contributor

bew commented Mar 10, 2024

Hello o/

When using the vi mode, when the completion menu is open, there is no way to cancel/hide the menu while staying in insert mode (pressing escape will hide the menu but also go to normal mode which I ~never want).
👉 I'd like to have a MenuCancel action to cancel the menu without changing the current mode.

Related to that, if I type echo f in a directory with files foobar & foobaz, the input will be changed to foo (the longest common text of the completion candidates), then when pressing escape to try to cancel the menu, the original input is not restored (I am left with echo foo instead of echo f.
I don't know if this should be filed as a bug report, but MenuCancel should restore the original input 🙏

video showing this behavior(/bug?)
nushell.compl.not.restoring.input.mov

Another menu action I'd I'm found of in zsh is the ability to accept current completion but keep the exact same completion menu open (and moving the selected completion to the next).
👉 I'd like to have MenuAcceptAndHold to accept current selection, append a space + what was used for previous completion and continue showing the completion menu.
Selecting the next entry could be moved avoided if we can execute multiple actions in a keybinding 🤔
(note: related to #624 asking for something like a MenuAccept action)

video showing this behavior in zsh
zsh.accept.and.hold.mov

References

Zsh Line Editor (ZLE) has bindable actions do that:

  • send-break to cancel current editor function (e.g. the completion menu)
  • accept-and-hold to accept current selection but keep completion menu open
@bew bew added the enhancement New feature or request label Mar 10, 2024
@bew bew changed the title New actions to cancel menu & accept-and-hold New actions to cancel menu & accept-and-hold selection Mar 10, 2024
@bew bew changed the title New actions to cancel menu & accept-and-hold selection New actions to cancel menu & accept-and-hold Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant