Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY] Use setlocal for temporary completeopt adjustment #4264

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this set the buffer local or global value? If it was previously globally set does this make it buffer local? I'm not sure that's desirable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does set the buffer-local value.If it was previously globally set, this does make it buffer-local.

I've manually tested this scenario:

  1. Do some completion thing, so that we mess with buffer-local completeopt.
  2. Manually mess with the global value. At the point, the buffer-local completeopt is destroyed, because global config changed.
  3. Do more completion.

That worked as expected and the end result is that both global and buffer-local completeopt have the same value.

Can you think of more potentially broken scenarios to test?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. SGTM.

Expand Down