Neovim-qt: Problem with uppercase accented characters

Created on 2 May 2017  Â·  5Comments  Â·  Source: equalsraf/neovim-qt

It seems to be currently impossible to type uppercase (latvian) characters like Ā, Ē, Š — special characters that require shift to be pressed. Everything works just fine in nvim in a terminal (urxvt, arch linux).

To reproduce, you may switch to a latvian keyboard layout (setxkbmap lv) and type altgr-S (observe lower-case Å¡) and altgr-shift-S (observe nothing, Å  expected).

InputConv.convertKey builds a

I worked around the issue by patching input.cpp to prevent any out-of-ASCII-range ( > 127) keys to have shift modifier ever sent, if nvim doesn't seem to support it:

      // Remove SHIFT
-     if (c.unicode() < 0x100 && !c.isLetterOrNumber() && c.isPrint()) {
-         mod &= ~ShiftModifier;
-     }
+     if (c.unicode() >= 0x80) {
+         mod &= ~ShiftModifier;
+     }
      ...

and it seems to be working, but I'm not sure what new cans of worms does it open.

Most helpful comment

This also happens on a German keyboard with capital umlauts (ÜÖÄ), which don't require any modifier keys (apart from shift, of course). Your patch fixes this for me as well.

All 5 comments

My original suggestion is buggy and is having issues with some ASCII symbols (shift-' to get a quote stopped working). This one's better:

      // Remove SHIFT
-     if (c.unicode() < 0x100 && !c.isLetterOrNumber() && c.isPrint()) {
+     if (c.unicode() >= 0x80 || (!c.isLetterOrNumber() && c.isPrint())) {

This also happens on a German keyboard with capital umlauts (ÜÖÄ), which don't require any modifier keys (apart from shift, of course). Your patch fixes this for me as well.

It is not impossible to type uppercase cyrillic letters on X11 and Windows.

Mentioned above change seems to fix the situation.

Does that referenced commit fix this issue? This is showbreaking for writing Docs/TeXs in German. I greatly appreciate a bugfix release for this.

at least for me ÜÄÖ are working now...
I was just patching according to the comment of @einars, so I have no idea if that is breakin something else..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgehrig picture jgehrig  Â·  8Comments

PhilT picture PhilT  Â·  10Comments

gwerbin picture gwerbin  Â·  10Comments

gagbo picture gagbo  Â·  6Comments

DustinVenegas picture DustinVenegas  Â·  10Comments