macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.53k stars 685 forks source link

Normal mode 'r' key doesn't work with macron / IM input #837

Open ychin opened 5 years ago

ychin commented 5 years ago

In macOS, you can enter macron input using an Option key sequence. E.g. Typing <M-e>, then i should result in "í" being inputted. This works in insert mode, but if you do this in the replace mode (r command in normal mode) it doesn't work. The above key sequence will enter ´, while the i will be ignored.

This can be worked around by disabling "Draw marked text inline" in advanced preferences but is not ideal, and there may be issues with how the replace mode interfaces with other input methods (IM) as well, so investigate and fix that.

Original discussion: https://groups.google.com/forum/#!topic/vim_mac/9JuxOuUFqgg

eirnym commented 5 years ago

Related issues(Possible duplicates): #389 #610 #768

eirnym commented 5 years ago

also #868

ychin commented 5 years ago

I feel that those issues all have slight subtle differences and prefer for them not to be closed out as dups. I have already tagged the label "Input" for all of them which should be sufficient for linking them together for now.

eirnym commented 5 years ago

I don't say that they're dups, but the same underlying nature of CoreText processing. I won't be surprised if Terminal.app first takes a keystroke first, and only then processes it and puts it into a text field.

ychin commented 5 years ago

That's fair. Most of these meta key issues have to do with how Vim itself works (some of the linked issues have some discussions on them) and how GVim thinks of itself as an "8bit" terminal by just setting the 8th bit when meta key is pressed (which doesn't work for a lot of non-ASCII input). MacVim can fix these issues itself but it will make upstream merges a lot more painful. Ideally Vim can change how it handles meta key better but that's a wider discussion. I think NeoVim has already found a good solution tbh (but that doesn't mean Vim has to do the exact same thing).