Vscode-neovim: Unexpected behaviors after key mapping

Created on 23 Nov 2019  路  4Comments  路  Source: asvetliakov/vscode-neovim

Hi, thank you for putting effort into vscode - neovim integration
really like it

but after some tastes, I ran into an issue when i need to remap keys
I mapped some key strokes to call editor.action.formatDocument,
editor called the command but also with some weird monifications.
I've recorded gifs below.
But when I manually call the command in nvim command prompt, it does not have this issue.
test2
test1

and here is my mapping

nnoremap <space><space> :<c-u>call VSCodeCall('editor.action.formatDocument')<cr>
vnoremap <space><space> :<c-u>call VSCodeCall('editor.action.formatSelection')<cr> 
bug

Most helpful comment

Debugged the problem - the problem it's the vscode command line sends additional <C-u> on change/initial appearing (to re-enter text) and it's causing weird behavior. <expr> doesn't use command line mode, so it works fine. Will fix today, thanks for reporting

All 4 comments

weird issue
this works

nnoremap <expr> <space><space> VSCodeCall('editor.action.formatDocument')

also i recommend to use VSCodeNotify unless you really need blocking call (e.g. you calling few commands and need to wait for previous one)

ok, thanks. Now it works like a charm.
yeah, I tried VSCodeNotify first, it has the same issue.

Debugged the problem - the problem it's the vscode command line sends additional <C-u> on change/initial appearing (to re-enter text) and it's causing weird behavior. <expr> doesn't use command line mode, so it works fine. Will fix today, thanks for reporting

The fix is landed in 0.0.32

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zeljkofilipin picture zeljkofilipin  路  3Comments

pieterdd picture pieterdd  路  4Comments

DrakeXiang picture DrakeXiang  路  5Comments

asvetliakov picture asvetliakov  路  5Comments

Liquidmantis picture Liquidmantis  路  3Comments