vhakulinen / gnvim

GUI for neovim, without any web bloat
MIT License
1.85k stars 68 forks source link

Keymap switching doesn't work #7

Closed sakhnik closed 1 year ago

sakhnik commented 5 years ago

The i_ctrl-^ does't switch keymaps.

:set keymap=ukrainian-jcuken
i<start typing anything>
ctrl-^ to switch back to English

Actual: 6 is printed Expected: default keymap is activated

vhakulinen commented 5 years ago

Didn't even knew about keymap or i_ctrl-^ but it seems to be working just fine for me.

If you run gnvim from terminal, do you see something along these lines once you press the last key on the key combination?

Failed to turn input event into nvim key (keyval: 65506)

For me, to complete ctrl-^, I need to process ctrl+shift+¨ where the last key is second row from the top, next to enter key (finnish/scandinavian keyboard). I first get the Failed to turn input event.... message for ctrl and shift but once I press the last key, gnvim manages to turn the input into something that it can send to nvim.

sakhnik commented 5 years ago

Right, there's a message:

Failed to turn input event into nvim key (keyval: 65505)
Received unknown redraw event: msg_showmode

Unfortunately, I wasn't able to figure out a workaround.

vhakulinen commented 5 years ago

Keyval 65505 is left shift for me. If you just press just left shift, will it give you the same message? The second line is irrelevant to this problem.

sakhnik commented 5 years ago

Oh, I'm sorry. That's the left shift. And nothing is printed for i_ctrl-^.

vhakulinen commented 5 years ago

Have you tried with an empty init.vim? Using -u NONE will make gnvim unable to load its runtime files (which are required), so empty init file is required instead.

sakhnik commented 5 years ago

Yes, I did. Still no luck.

vhakulinen commented 5 years ago

Just to make sure, did you run gnvim -- -u <empty.vim file>? Also, are you able to just type ^ in insert mode?

sakhnik commented 5 years ago

Affirmative to both questions.

vhakulinen commented 5 years ago

I enabled ukrainian keyboard layout on my machine, and after setting :set keymap=ukrainian-jcuken I was not able to type ^ in insert mode (same as you) while I was able to do so without setting the keymap. I tried the same with TUI nvim (gnome-terminal) and got the exact opposite results (everything worked as expected with ukrainian layout but not with finnish layout).

This certainly is weird.

SirJson commented 5 years ago

Similar issue with the US Layout (intl., with AltGr dead keys).

Every time I press the shift key it prints Failed to turn input event into nvim key (keyval: 65506) into my terminal which in turn spams neovim with "No matching autocommands". I think that's because it I need it for the colon key opens the command line prompt?

When I press the ctrl key it prints Failed to turn input event into nvim key (keyval: 65507). To confirm this behavior I completely removed every piece of neovim config I wrote and ran the same test with neovim inside Alacritty, xfce4-terminal, nvim-qt and neovim-gtk. None of those show this behavior.

For some reason it get worse when I use addons like startify or coc. In that case my neovim message line just gets spammed with "No matching autocommands" which makes it useless.

vhakulinen commented 5 years ago

The "No matching autocommands" message is unrelated to this problem, and should be fixed in 4b248cd. Failed to turn input event into nvim key... messages are mostly for debugging purposes. Shift and ctrl keys aren't send as is to nvim (they dont do anything in TUI, do they?). Once you combine them with another key, the key combination is sent to nvim (for example, <c-r>).

YaLTeR commented 5 years ago

I'm having the same issue with the normal mode Ctrl-^ / Ctrl-6 binding. It just inputs the number 6 (as if it was the repeat count I was inputting).

vhakulinen commented 1 year ago

Gnvim was rewritten from ground up for gtk4. If the problem persists, feel free to reopen this issue.