forked from github-mirrors/ale
Fix #2971 - Disable automatic completion while 'paste' is active
This commit is contained in:
parent
6888ca46a7
commit
6e2e51b154
|
@ -324,6 +324,12 @@ function! ale#completion#AutomaticOmniFunc(findstart, base) abort
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:OpenCompletionMenu(...) abort
|
||||||
|
if !&l:paste
|
||||||
|
call ale#util#FeedKeys("\<Plug>(ale_show_completion_menu)")
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale#completion#Show(result) abort
|
function! ale#completion#Show(result) abort
|
||||||
if ale#util#Mode() isnot# 'i'
|
if ale#util#Mode() isnot# 'i'
|
||||||
return
|
return
|
||||||
|
@ -344,10 +350,7 @@ function! ale#completion#Show(result) abort
|
||||||
let l:source = get(get(b:, 'ale_completion_info', {}), 'source', '')
|
let l:source = get(get(b:, 'ale_completion_info', {}), 'source', '')
|
||||||
|
|
||||||
if l:source is# 'ale-automatic' || l:source is# 'ale-manual'
|
if l:source is# 'ale-automatic' || l:source is# 'ale-manual'
|
||||||
call timer_start(
|
call timer_start(0, function('s:OpenCompletionMenu'))
|
||||||
\ 0,
|
|
||||||
\ {-> ale#util#FeedKeys("\<Plug>(ale_show_completion_menu)")}
|
|
||||||
\)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if l:source is# 'ale-callback'
|
if l:source is# 'ale-callback'
|
||||||
|
|
|
@ -463,6 +463,9 @@ is loaded. The delay for completion can be configured with
|
||||||
|g:ale_completion_delay|. This setting should not be enabled if you wish to
|
|g:ale_completion_delay|. This setting should not be enabled if you wish to
|
||||||
use ALE as a completion source for other plugins.
|
use ALE as a completion source for other plugins.
|
||||||
|
|
||||||
|
ALE automatic completion will not work when 'paste' is active. Only set
|
||||||
|
'paste' when you are copy and pasting text into your buffers.
|
||||||
|
|
||||||
ALE provides an 'omnifunc' function |ale#completion#OmniFunc| for triggering
|
ALE provides an 'omnifunc' function |ale#completion#OmniFunc| for triggering
|
||||||
completion manually with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| >
|
completion manually with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| >
|
||||||
|
|
||||||
|
@ -729,6 +732,9 @@ g:ale_completion_enabled *g:ale_completion_enabled*
|
||||||
This setting should not be enabled if you wish to use ALE as a completion
|
This setting should not be enabled if you wish to use ALE as a completion
|
||||||
source for other completion plugins.
|
source for other completion plugins.
|
||||||
|
|
||||||
|
ALE automatic completion will not work when 'paste' is active. Only set
|
||||||
|
'paste' when you are copy and pasting text into your buffers.
|
||||||
|
|
||||||
A buffer-local version of this setting `b:ale_completion_enabled` can be set
|
A buffer-local version of this setting `b:ale_completion_enabled` can be set
|
||||||
to `0` to disable ALE's automatic completion support for a single buffer.
|
to `0` to disable ALE's automatic completion support for a single buffer.
|
||||||
ALE's completion support must be enabled globally to be enabled locally.
|
ALE's completion support must be enabled globally to be enabled locally.
|
||||||
|
|
Loading…
Reference in New Issue