mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-03 10:03:47 +08:00
Fix #2535 - Automatically emit <C-x><C-o> less to prevent <C-o> issues
This commit is contained in:
@@ -216,18 +216,6 @@ function! ale#completion#GetCompletionPosition() abort
|
||||
endfunction
|
||||
|
||||
function! ale#completion#GetCompletionResult() abort
|
||||
" Parse a new response if there is one.
|
||||
if exists('b:ale_completion_response')
|
||||
\&& exists('b:ale_completion_parser')
|
||||
let l:response = b:ale_completion_response
|
||||
let l:parser = b:ale_completion_parser
|
||||
|
||||
unlet b:ale_completion_response
|
||||
unlet b:ale_completion_parser
|
||||
|
||||
let b:ale_completion_result = function(l:parser)(l:response)
|
||||
endif
|
||||
|
||||
if exists('b:ale_completion_result')
|
||||
return b:ale_completion_result
|
||||
endif
|
||||
@@ -247,15 +235,20 @@ function! ale#completion#AutomaticOmniFunc(findstart, base) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#completion#Show(response, completion_parser) abort
|
||||
function! ale#completion#Show(result) abort
|
||||
if ale#util#Mode() isnot# 'i'
|
||||
return
|
||||
endif
|
||||
|
||||
" Set the list in the buffer, temporarily replace omnifunc with our
|
||||
" function, and then start omni-completion.
|
||||
let b:ale_completion_response = a:response
|
||||
let b:ale_completion_parser = a:completion_parser
|
||||
let b:ale_completion_result = a:result
|
||||
|
||||
" Don't try to open the completion menu if there's nothing to show.
|
||||
if empty(b:ale_completion_result)
|
||||
return
|
||||
endif
|
||||
|
||||
" Replace completion options shortly before opening the menu.
|
||||
call s:ReplaceCompletionOptions()
|
||||
|
||||
@@ -475,8 +468,7 @@ function! ale#completion#HandleTSServerResponse(conn_id, response) abort
|
||||
endif
|
||||
elseif l:command is# 'completionEntryDetails'
|
||||
call ale#completion#Show(
|
||||
\ a:response,
|
||||
\ 'ale#completion#ParseTSServerCompletionEntryDetails',
|
||||
\ ale#completion#ParseTSServerCompletionEntryDetails(a:response),
|
||||
\)
|
||||
endif
|
||||
endfunction
|
||||
@@ -488,8 +480,7 @@ function! ale#completion#HandleLSPResponse(conn_id, response) abort
|
||||
endif
|
||||
|
||||
call ale#completion#Show(
|
||||
\ a:response,
|
||||
\ 'ale#completion#ParseLSPCompletions',
|
||||
\ ale#completion#ParseLSPCompletions(a:response),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
@@ -585,8 +576,6 @@ function! ale#completion#GetCompletions(source) abort
|
||||
\ 'request_id': 0,
|
||||
\ 'source': a:source,
|
||||
\}
|
||||
unlet! b:ale_completion_response
|
||||
unlet! b:ale_completion_parser
|
||||
unlet! b:ale_completion_result
|
||||
|
||||
let l:buffer = bufnr('')
|
||||
|
||||
Reference in New Issue
Block a user