File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed
Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,13 @@ function! s:FZF(source, sink) abort
138138 return
139139 endif
140140
141- if exists (' LanguageClient_fzfOptions' )
142- let l: options = LanguageClient_fzfOptions
143- elseif exists (' *fzf#vim#with_preview' )
144- let l: options = fzf#vim#with_preview (' right:50%:hidden' , ' ?' ).options
145- else
146- let l: options = []
141+ let l: options = s: GetVar (' LanguageClient_fzfOptions' )
142+ if l: options is v: null
143+ if exists (' *fzf#vim#with_preview' )
144+ let l: options = fzf#vim#with_preview (' right:50%:hidden' , ' ?' ).options
145+ else
146+ let l: options = []
147+ endif
147148 endif
148149 call fzf#run (fzf#wrap ({
149150 \ ' source' : a: source ,
@@ -187,6 +188,20 @@ function! s:AddHighlights(source, highlights) abort
187188 endfor
188189endfunction
189190
191+ " Get an variable value.
192+ " First try buffer local, then global, then default, then v:null.
193+ function ! s: GetVar (... ) abort
194+ let name = a: 0
195+
196+ if exists (' b:' . name)
197+ return get (b: , name)
198+ elseif exists (' g:' . name)
199+ return get (g: , name)
200+ else
201+ return get (a: 000 , 1 , v: null )
202+ endif
203+ endfunction
204+
190205let s: id = 1
191206let s: handlers = {}
192207
You can’t perform that action at this time.
0 commit comments