Skip to content

Commit

Permalink
bugfix for #303
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Nov 7, 2024
1 parent 680508d commit 7c31936
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions autoload/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,24 @@ function! easycomplete#Down()
return "\<Down>"
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 "\<Left>"
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 "\<Right>"
endfunction

" 参考 asynccomplete 并做了扩充
function! easycomplete#context() abort
let l:ret = {
Expand Down
2 changes: 2 additions & 0 deletions plugin/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ inoremap <expr> <Down> easycomplete#Down()
if g:env_is_nvim
inoremap <expr> <C-N> easycomplete#CtlN()
inoremap <expr> <C-P> easycomplete#CtlP()
inoremap <expr> <Left> easycomplete#Left()
inoremap <expr> <Right> easycomplete#Right()
endif
" inoremap <silent><expr> <BS> easycomplete#BackSpace()
inoremap <silent> <Plug>EasycompleteTabTrigger <c-r>=easycomplete#CleverTab()<cr>
Expand Down

0 comments on commit 7c31936

Please sign in to comment.