Input: `<space>` or ` ` do not work in unbinding
Oni Version: 0.3.6 Operating System: Windows 7 32-bit (also witnessed on Windows 10 64-bit)
Issue:
<space> or (literal space) are not recognized in oni.input.unbind
This might be related to #1300.
Expected behavior:
When oni.input.unbind("<space>") is present in config.tsx, pressing the spacebar in Normal mode should not move the cursor(i.e. it should do nothing).
Actual behavior: Pressing the spacebar in Normal mode advances the cursor one position.
Steps to reproduce:
- Load Onivim
- Add
oni.input.unbind("<space>")toconfig.tsx - Load any buffer with text(or add text to empty buffer)
- Move cursor to anywhere but the end of the buffer
- Press the spacebar
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.
Hi!
I think this is actually a fault of our docs, rather than the code. When you use oni.input.unbind you are unbinding that action in Oni, not in Neovim. That then means the sequence you've unbound will be passed straight through to neovim, rather than Oni trying to interpret it and call a command for it.
In this case, the <space> is being passed straight through to neovim, and then neovim is the one advancing the character, since I think that is the default behaviour in vim/neovim. I gave this a quick try in terminal neovim and it seemed to be the same.
If you wanted <space> to not do anything in normal mode, you'd need to do something like:
oni.editors.activeEditor.neovim.command("nnoremap <Space> <NOP>") which will tell neovim to unbind it.
@jabocg, does the thumbs up on the previous comment mean we can close this issue?
Yes, feel free.
Thanks!