1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:50:04 +08:00

Fix vim popup bug (#3616)

ref: https://github.com/vim/vim/issues/6424
This commit is contained in:
Wang Shidong 2020-07-09 20:55:27 +08:00 committed by GitHub
parent 2c96390ba9
commit bf511cd02b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -447,10 +447,21 @@ function! s:handle_input(input) abort " {{{
endif
endfunction " }}}
function! s:getchar(...) abort
if has('nvim')
function! s:getchar(...) abort
let ret = call('getchar', a:000)
return (type(ret) == type(0) ? nr2char(ret) : ret)
endfunction
endfunction
else
function! s:getchar(...) abort
let ret = call('getchar', a:000)
while ret ==# "\x80\xfd\d"
let ret = call('getchar', a:000)
endwhile
return (type(ret) == type(0) ? nr2char(ret) : ret)
endfunction
endif
" wait for in input sub function should be not block vim