Skip to content

Commit

Permalink
Use setlocal for temporary completeopt adjustment
Browse files Browse the repository at this point in the history
Since vim 9.1.0469, completeopt is a global-local option.  When adding
`noselect`, we need to treat `completeopt` as local and use `setlocal`.
This works for 9.1.0016 as well and allows users to freely mess with
buffer-local `completeopt` without messing up YCM completions.
  • Loading branch information
bstaletic committed Sep 13, 2024
1 parent 80728a1 commit d517711
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/youcompleteme.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ function! s:Complete()
endif
if len( s:completion.completions )
let old_completeopt = &completeopt
set completeopt+=noselect
setlocal completeopt+=noselect
call complete( s:completion.completion_start_column,
\ s:completion.completions )
let &completeopt = old_completeopt
Expand Down

0 comments on commit d517711

Please sign in to comment.