yatli / fvim

Cross platform Neovim front-end UI, built with F# + Avalonia
MIT License
1.34k stars 30 forks source link

Can not input <C-h> on Windows #45

Closed jjohnson338 closed 5 years ago

jjohnson338 commented 5 years ago

I've the following line in my .vimrc to map h to but it's not seeming to work in fvim.

nnoremap <C-h> <C-w>h

yatli commented 5 years ago

Investigating -- thanks!

yatli commented 5 years ago

@jjohnson338 ^H was translated to backspace -- standard ANSI sequence. However, just sending over ^H to neovim results in reinterpretation just fine -- same for ^[, ^I, etc -- so I'm removing the translation code.

jjohnson338 commented 5 years ago

Thanks for investigating this. Unfortunately, the issue still persists. I've tried both v0.2-50-g6b4c309 and v0.2-51-g98b2006 on Windows 10.

For further context I've four remaps in my vimrc for jumping between windows/visible buffers:

" Control+hjkl moves focus to that window
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l

On the current release, only right (<C-l>) and up (<C-k>) are working as expected.

If there is anything I can do to aid in the debugging, please let me know.

yatli commented 5 years ago

I've tried the Ctrl+hjkl on my side, <C-h> doesn't work, <C-j> and <C-l> work as expected. <C-k> works, with delay -- try <C-k> followed by other <C-> keys in insert mode and I've got some interesting mojibakes (some unicode glyphs)

Can you confirm this? Also, could you try to map it in insert mode, and see what will happen? I think neovim simply ignored or misinterpreted these combos.

yatli commented 5 years ago

FYI, <C-I> <C-J> <C-M> are not interpreted correctly if sent directly. Translation to the corresponding ANSI code is still necessary -- and I think it is the same case for <C-h>, which translates to <Backspace>

jjohnson338 commented 5 years ago

Can confirm that <C-k> then another character will insert unicode glyphs: <C-k>aa resulted in the following character: å

<C-l> (right) and <C-k> (up) work for me, but <C-h> and <C-j> do not. I changed my mappings to insert mode:

inoremap <C-h> <C-w>h
inoremap <C-j> <C-w>j
inoremap <C-k> <C-w>k
inoremap <C-l> <C-w>l

and tested out in a buffer. <C-h> just enters an 'h' character

<C-j> just enters an 'l' character

<C-k> removes the entire line and then enters an 'k' character (not just backspace, but wipes the line it's entered on if there are preceeding characters, otherwise, will remove the line entirely and append to the previous line

<C-l> does the same as <C-k> (wiping the line, then entering the character)

yatli commented 5 years ago

@jjohnson338 FYI:

https://github.com/neovim/neovim/issues/2048 https://github.com/lxqt/qtermwidget/issues/235

yatli commented 5 years ago

nvim-qt seems to handle this correctly.

jjohnson338 commented 5 years ago

Yeah, these keybinds work on nvim-qt. Was using that as my daily driver before fvim.

yatli commented 5 years ago

I'm looking at nvim-qt and hunting for the magic. 0.0

yatli commented 5 years ago

@jjohnson338 well there's no magic -- I was doing it right to remove the translation -- only forgetting that I've got some other special treatments on the modifiers that also needs to be removed!

yatli commented 5 years ago

try 0.2-56 (when it finishes building)

jjohnson338 commented 5 years ago

Works great! Thanks so much!