mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-17 23:44:17 +08:00
Close #3433 - Only use noselect if set for automatic completion
This commit is contained in:
@@ -269,13 +269,19 @@ function! s:ReplaceCompletionOptions(source) abort
|
||||
let b:ale_old_completeopt = &l:completeopt
|
||||
endif
|
||||
|
||||
if &l:completeopt =~# 'preview'
|
||||
let &l:completeopt = 'menu,menuone,preview,noselect,noinsert'
|
||||
elseif &l:completeopt =~# 'popup'
|
||||
let &l:completeopt = 'menu,menuone,popup,noselect,noinsert'
|
||||
else
|
||||
let &l:completeopt = 'menu,menuone,noselect,noinsert'
|
||||
endif
|
||||
let l:opt_list = split(&l:completeopt, ',')
|
||||
" The menu and noinsert options must be set, or automatic completion
|
||||
" will be annoying.
|
||||
let l:new_opt_list = ['menu', 'menuone', 'noinsert']
|
||||
|
||||
" Permit some other completion options, provided users have set them.
|
||||
for l:opt in ['preview', 'popup', 'noselect']
|
||||
if index(l:opt_list, l:opt) >= 0
|
||||
call add(l:new_opt_list, l:opt)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let &l:completeopt = join(l:new_opt_list, ',')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user