oni icon indicating copy to clipboard operation
oni copied to clipboard

Input: `<space>` or ` ` do not work in unbinding

Open jabocg opened this issue 8 years ago • 5 comments

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:

  1. Load Onivim
  2. Add oni.input.unbind("<space>") to config.tsx
  3. Load any buffer with text(or add text to empty buffer)
  4. Move cursor to anywhere but the end of the buffer
  5. Press the spacebar

jabocg avatar Jul 09 '18 23:07 jabocg

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.

oni-bot avatar Jul 09 '18 23:07 oni-bot

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.

CrossR avatar Jul 09 '18 23:07 CrossR

@jabocg, does the thumbs up on the previous comment mean we can close this issue?

keforbes avatar Jul 11 '18 21:07 keforbes

Yes, feel free.

jabocg avatar Jul 11 '18 21:07 jabocg

Thanks!

keforbes avatar Jul 11 '18 21:07 keforbes