File: 0006-Use-setlocal-for-temporary-completeopt-adjustment.patch

package info (click to toggle)
vim-youcompleteme 0%2B20240827%2Bgitb6e8c64%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,436 kB
  • sloc: python: 10,914; sh: 204; cpp: 141; makefile: 26; f90: 5; xml: 1
file content (29 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From d51771132ca48d0f57dca5089d08e7f6c944d376 Mon Sep 17 00:00:00 2001
From: Boris Staletic <boris.staletic@protonmail.com>
Date: Sat, 14 Sep 2024 01:27:19 +0200
Subject: [PATCH] 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.
---
 autoload/youcompleteme.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim
index 3ca046b2..ec8109ea 100644
--- a/autoload/youcompleteme.vim
+++ b/autoload/youcompleteme.vim
@@ -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
-- 
2.45.2