equalsraf / neovim-qt

Neovim client library and GUI, in Qt5.
https://github.com/equalsraf/neovim-qt/wiki
ISC License
1.86k stars 171 forks source link

Neovim 0.7 - distinguish between <cr> & <c-m>, <tab> & <c-i>, and <esc> & <c-[> #987

Open DasOhmoff opened 2 years ago

DasOhmoff commented 2 years ago

Hey :wave:

Neovim 0.7 has the following feature:

input: distinguish between some input keys which previously were synonyms. This will break some exiting mappings.

\, \ and \ are no longer considered equivalent to \, \ and \<c-[> respectively. In case the terminal or GUI supports distinguishing these keys, these can now be mapped separately. But even if the terminal only can send one code you might still need to change what variant is used in the config.

Notice that it said: In case the terminal or GUI supports distinguishing these keys

This introduced breaking changes into neovim-qt. I have mappings that are effected by this change. For example and scroll horizontally left and right on my setup. But with the new neovim 0.7 version, does not work anymore. Also other mappings that use <c-[> and are broken.

It would be appreciated it this could be fixed. Thank you for your help :)

justinmk commented 2 years ago

I have mappings that are effected by this change. For example and scroll horizontally left and right on my setup. But with the new neovim 0.7 version, does not work anymore. Also other mappings that use <c-[> and are broken.

What are the mappings exactly? Provide a full, concrete example.

DasOhmoff commented 2 years ago

For example <c-m> in the following mappings don't work:

nnoremap <expr> <c-n> 10 . 'zh'
nnoremap <expr> <c-m> 10 . 'zl'

These are there to horizontally scroll left and right when pressing <c-n> and <c-m>. <c-n> still works, it scrolls left, but <c-m> does not scroll right. It behaves as if it was unmapped, it makes the cursor jump to the beginning of the next line.

DasOhmoff commented 2 years ago

Hello. I still have this issue

justinmk commented 2 years ago

but <c-m> does not scroll right. It behaves as if it was unmapped, it makes the cursor jump to the beginning of the next line.

Ah, that hints that neovim-qt is probably sending <cr> when it sees <c-m>. Neovim-qt probably needs to make a change there, because those are no longer equivalent in Nvim.

DasOhmoff commented 2 years ago

Yes, I think so too

jgehrig commented 1 year ago

Ah, that hints that neovim-qt is probably sending when it sees . Neovim-qt probably needs to make a change there, because those are no longer equivalent in Nvim.

From what I can tell, this is not the case. We seem to be sending and for the respective events.

QKeyEvent ev: QKeyEvent(KeyPress, Key_M, ControlModifier, text="\r")
   "<C-m>"
QKeyEvent ev: QKeyEvent(KeyPress, Key_Return, text="\r")
   "<Enter>"

@DasOhmoff

It would be helpful if you can provide a few things.

  1. A repro case for nvim-qt -- -u yourconfig.vim, with steps that do not work on 0.7.
  2. Un-comment these lines, build, and provide output for the steps above.
  3. Platform/OS you're running.

It is possible the issue is platform specific, and the QKeyEvent data should help us diagnose then fix the problem.