Skip to content

Commit d517711

Browse files
committed
Use setlocal for temporary completeopt adjustment
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.
1 parent 80728a1 commit d517711

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/youcompleteme.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ function! s:Complete()
13571357
endif
13581358
if len( s:completion.completions )
13591359
let old_completeopt = &completeopt
1360-
set completeopt+=noselect
1360+
setlocal completeopt+=noselect
13611361
call complete( s:completion.completion_start_column,
13621362
\ s:completion.completions )
13631363
let &completeopt = old_completeopt

0 commit comments

Comments
 (0)