onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.35k stars 301 forks source link

Cmd-Backspace/Delete does not work in "Cmd-p" bar #2324

Open billyvg opened 6 years ago

billyvg commented 6 years ago

Oni Version: 0.3.4 Neovim Version (Linux only): Operating System: OSX 10.13.5

Describe your issue

When using the "cmd-p" bar, using a modifier with backspace does not do anything.

Expected behaviour

cmd+backspace should delete the entire line, ctrl+backspace should delete last word.

Actual behaviour

Nothing happens

Steps to reproduce

oni-bot[bot] commented 6 years ago

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

CrossR commented 6 years ago

Just to check, is this assumption based on Shell bindings, or Vim bindings?

I've always used Ctrl-w to delete the previous word in vim, and that binding works fine in any of the menus. Similarly, Ctrl-u works to delete the entire line.

That said, I do remember someone else raised this issue, so perhaps its worth adding an option for it, or making sure rebinding it is easy.

billyvg commented 6 years ago

This assumption is more based on OS bindings I think. Since the input bar pops out with its own UI, it felt disconnected from the editor/vi and it was my natural instinct to use hotkeys that work across my os (OSX).

Speculative commented 6 years ago

I was curious about this a little while ago and found where input key events are processed.

AFAICT this wraps a regular HTML text input element. The reason ctrl+ platform-specific bindings aren't working (which should come for free with Electron) is this switch/case defaults to swallowing keybinds that it doesn't recognize. I wasn't sure if this was a bug or a feature (I personally would like to Ctrl+A to select all, which is a habit that carries over from the way I interact with text inputs in the rest of Windows).

Regardless, it seems like a pretty case-by-case kind of basis. We can patch in these keybindings if we want to?