Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Jan 2, 2024
1 parent 3857335 commit fdb3298
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions autoload/easycomplete/pum.vim
Original file line number Diff line number Diff line change
Expand Up @@ -422,22 +422,17 @@ function! easycomplete#pum#SetWordBySelecting()
endfunction

function! s:InsertWord(word)
try
let saved_completeopt = &completeopt
let startcol = s:original_ctx["startcol"]
noa set completeopt=menu
if &textwidth > 0
let textwidth = &textwidth
noa setl textwidth=0
call timer_start(0, { -> execute('noa setl textwidth='.textwidth)})
endif
silent! noa call complete(startcol, [{ 'empty': v:true, 'word': a:word }])
silent! noa call complete(startcol, [])
execute 'noa set completeopt='.saved_completeopt
catch
call s:console(v:exception)

endtry
let saved_completeopt = &completeopt
let startcol = s:original_ctx["startcol"]
noa set completeopt=menu
if &textwidth > 0
let textwidth = &textwidth
noa setl textwidth=0
call timer_start(0, { -> execute('noa setl textwidth='.textwidth)})
endif
silent! noa call complete(startcol, [{ 'empty': v:true, 'word': a:word }])
silent! noa call complete(startcol, [])
execute 'noa set completeopt='.saved_completeopt
endfunction

function! easycomplete#pum#select(line_index)
Expand Down

0 comments on commit fdb3298

Please sign in to comment.