neovim-qt icon indicating copy to clipboard operation
neovim-qt copied to clipboard

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

Open DasOhmoff opened this issue 3 years ago • 6 comments

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.

<cr>, <tab> and <esc> are no longer considered equivalent to <c-m>, <c-i> 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 :)

DasOhmoff avatar Jun 04 '22 18:06 DasOhmoff

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.

justinmk avatar Jun 06 '22 11:06 justinmk

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 avatar Jun 13 '22 15:06 DasOhmoff

Hello. I still have this issue

DasOhmoff avatar Aug 29 '22 12:08 DasOhmoff

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.

justinmk avatar Sep 11 '22 22:09 justinmk

Yes, I think so too

DasOhmoff avatar Sep 12 '22 09:09 DasOhmoff

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 <C-M> and <CR> 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.

jgehrig avatar May 03 '23 03:05 jgehrig