diff options
author | w0rp <devw0rp@gmail.com> | 2016-09-15 10:57:11 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2016-09-15 10:57:11 +0100 |
commit | b236b6b35310ad4d50017b95ac20a2a5ffb9950c (patch) | |
tree | cc334e992d989e31ade7aa1ea50c36ef301dc560 /plugin | |
parent | 7fa437985fda31328dc23973a38fc9007b528c2b (diff) | |
download | ale-b236b6b35310ad4d50017b95ac20a2a5ffb9950c.zip |
Echo the cursor status with a very short delay, so it will override other plugins.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/ale/cursor.vim | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugin/ale/cursor.vim b/plugin/ale/cursor.vim index aa8ae7a1..234060a8 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 |