From b236b6b35310ad4d50017b95ac20a2a5ffb9950c Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 15 Sep 2016 10:57:11 +0100 Subject: [PATCH] Echo the cursor status with a very short delay, so it will override other plugins. --- plugin/ale/cursor.vim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugin/ale/cursor.vim b/plugin/ale/cursor.vim index aa8ae7a..234060a 100644 --- a/plugin/ale/cursor.vim +++ b/plugin/ale/cursor.vim @@ -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