mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 21:42:31 +08:00
#1700 - Try using a 0ms timer showing the completion menu
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Completion support for LSP linters
|
||||
|
||||
function! ale#completion#TriggerOmnicompleteMenu() abort
|
||||
" Replace completion options shortly before opening the menu.
|
||||
call s:ReplaceCompletionOptions()
|
||||
|
||||
return "\<C-x>\<C-o>"
|
||||
endfunction
|
||||
|
||||
" The omnicompletion menu is shown through a special Plug mapping which is
|
||||
" only valid in Insert mode. This way, feedkeys() won't send these keys if you
|
||||
" quit Insert mode quickly enough.
|
||||
inoremap <silent> <Plug>(ale_show_completion_menu) <C-R>=ale#completion#TriggerOmnicompleteMenu()<CR>
|
||||
inoremap <silent> <Plug>(ale_show_completion_menu) <C-x><C-o>
|
||||
" If we hit the key sequence in normal mode, then we won't show the menu, so
|
||||
" we should restore the old settings right away.
|
||||
nnoremap <silent> <Plug>(ale_show_completion_menu) :call ale#completion#RestoreCompletionOptions()<CR>
|
||||
@@ -221,7 +214,10 @@ function! ale#completion#Show(response, completion_parser) abort
|
||||
" function, and then start omni-completion.
|
||||
let b:ale_completion_response = a:response
|
||||
let b:ale_completion_parser = a:completion_parser
|
||||
call ale#util#FeedKeys("\<Plug>(ale_show_completion_menu)")
|
||||
" Replace completion options shortly before opening the menu.
|
||||
call s:ReplaceCompletionOptions()
|
||||
|
||||
call timer_start(0, {-> ale#util#FeedKeys("\<Plug>(ale_show_completion_menu)")})
|
||||
endfunction
|
||||
|
||||
function! s:CompletionStillValid(request_id) abort
|
||||
|
||||
Reference in New Issue
Block a user