Echo the cursor status with a very short delay, so it will override other plugins.

This commit is contained in:
w0rp 2016-09-15 10:57:11 +01:00
parent 7fa437985f
commit b236b6b353

View File

@ -52,7 +52,7 @@ function! ale#cursor#TruncatedEcho(message)
echo truncated_message
endfunction
function! ale#cursor#EchoCursorWarning()
function! ale#cursor#EchoCursorWarning(...)
let buffer = bufnr('%')
if !has_key(g:ale_buffer_loclist_map, buffer)
@ -72,9 +72,20 @@ function! ale#cursor#EchoCursorWarning()
endif
endfunction
let s:cursor_timer = -1
function! ale#cursor#EchoCursorWarningWithDelay()
if s:cursor_timer != -1
call timer_stop(s:cursor_timer)
let s:cursor_timer = -1
endif
let s:cursor_timer = timer_start(10, function('ale#cursor#EchoCursorWarning'))
endfunction
if g:ale_echo_cursor
augroup ALECursorGroup
autocmd!
autocmd CursorMoved * call ale#cursor#EchoCursorWarning()
autocmd CursorMoved,CursorHold * call ale#cursor#EchoCursorWarningWithDelay()
augroup END
endif