mirror of
https://github.com/prabirshrestha/asyncomplete.vim.git
synced 2025-12-14 20:35:41 +01:00
add support for complete_info to ignore built-in completions
This commit is contained in:
@@ -25,6 +25,7 @@ endif
|
||||
let s:already_setup = 0
|
||||
let s:sources = {}
|
||||
let s:matches = {} " { server_name: { incomplete: 1, startcol: 0, items: [], refresh: 0, status: 'idle|pending|success|failure', ctx: ctx } }
|
||||
let s:has_complete_info = exists('*complete_info')
|
||||
|
||||
function! s:setup_if_required() abort
|
||||
if !s:already_setup
|
||||
@@ -382,12 +383,10 @@ function! s:recompute_pum(...) abort
|
||||
\ 'startcol': l:startcol,
|
||||
\ }, l:ctx)
|
||||
|
||||
if empty(g:asyncomplete_preprocessor)
|
||||
if !pumvisible()
|
||||
call s:default_preprocessor(l:filter_ctx, l:matches_to_filter)
|
||||
endif
|
||||
else
|
||||
call g:asyncomplete_preprocessor[0](l:filter_ctx, l:matches_to_filter)
|
||||
let l:mode = s:has_complete_info ? complete_info(['mode'])['mode'] : 'unknown'
|
||||
if l:mode ==# '' || l:mode ==# 'eval' || l:mode ==# 'unknown'
|
||||
let l:Preprocessor = empty(g:asyncomplete_preprocessor) ? function('s:default_preprocessor') : g:asyncomplete_preprocessor[0]
|
||||
call l:Preprocessor(l:filter_ctx, l:matches_to_filter)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user