From 7c319365bdfe012ad9d6d0c83bfadacd40613d49 Mon Sep 17 00:00:00 2001 From: lijing00333 Date: Thu, 7 Nov 2024 16:50:29 +0800 Subject: [PATCH] bugfix for #303 --- autoload/easycomplete.vim | 18 ++++++++++++++++++ plugin/easycomplete.vim | 2 ++ 2 files changed, 20 insertions(+) diff --git a/autoload/easycomplete.vim b/autoload/easycomplete.vim index 5e498e3..9654585 100644 --- a/autoload/easycomplete.vim +++ b/autoload/easycomplete.vim @@ -541,6 +541,24 @@ function! easycomplete#Down() return "\" endfunction +function! easycomplete#Left() + if g:env_is_vim + " do nothing + elseif g:env_is_nvim && easycomplete#pum#visible() + call timer_start(5, { -> easycomplete#pum#close() }) + endif + return "\" +endfunction + +function! easycomplete#Right() + if g:env_is_vim + " do nothing + elseif g:env_is_nvim && easycomplete#pum#visible() + call timer_start(5, { -> easycomplete#pum#close() }) + endif + return "\" +endfunction + " 参考 asynccomplete 并做了扩充 function! easycomplete#context() abort let l:ret = { diff --git a/plugin/easycomplete.vim b/plugin/easycomplete.vim index 693f867..6ef8f86 100644 --- a/plugin/easycomplete.vim +++ b/plugin/easycomplete.vim @@ -579,6 +579,8 @@ inoremap easycomplete#Down() if g:env_is_nvim inoremap easycomplete#CtlN() inoremap easycomplete#CtlP() + inoremap easycomplete#Left() + inoremap easycomplete#Right() endif " inoremap easycomplete#BackSpace() inoremap EasycompleteTabTrigger =easycomplete#CleverTab()