Skip to content

Commit

Permalink
bugfix for #231, do not close menu manually before expanding snippts
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Dec 5, 2023
1 parent 3b022dd commit f7b5713
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions autoload/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1197,12 +1197,15 @@ function! s:ExpandSnipManually(word)
try
if index(keys(UltiSnips#SnippetsInCurrentScope()), a:word) >= 0
" 可直接展开
call s:CloseCompletionMenu()
" bugfix for #231,加上 CloseCompletionMenu
" 会导致如果上一行有内容,且当前列字符不为空时,关闭menu后会把不为空的字符带到当前行的光标处
" 原因未知,先注释掉这一行 在 nvim 中是 ok 的 vim 未测试
" call s:CloseCompletionMenu()
call feedkeys("\<C-R>=UltiSnips#ExpandSnippetOrJump()\<cr>")
return ""
elseif empty(UltiSnips#SnippetsInCurrentScope())
" 需要展开选项
call s:CloseCompletionMenu()
" call s:CloseCompletionMenu()
call feedkeys("\<Plug>EasycompleteExpandSnippet")
return ""
endif
Expand Down

0 comments on commit f7b5713

Please sign in to comment.