summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-12 23:25:41 +0100
committerw0rp <devw0rp@gmail.com>2017-10-12 23:25:41 +0100
commit663fe75d0faaf038e6f5e67a97940bf10990c0f0 (patch)
treeabcfcd211a84f677955fe906c1e41f90f3cb029b
parente71c4a8bea25e6998d4d852677790ad6bd5a7e68 (diff)
downloadale-663fe75d0faaf038e6f5e67a97940bf10990c0f0.zip
#965 - Make the cursor echo delay configurable
-rw-r--r--autoload/ale/cursor.vim7
-rw-r--r--doc/ale.txt12
-rw-r--r--plugin/ale.vim2
3 files changed, 20 insertions, 1 deletions
diff --git a/autoload/ale/cursor.vim b/autoload/ale/cursor.vim
index f5394a43..6238b4a9 100644
--- a/autoload/ale/cursor.vim
+++ b/autoload/ale/cursor.vim
@@ -113,8 +113,13 @@ function! ale#cursor#EchoCursorWarningWithDelay() abort
" we should echo something. Otherwise we can end up doing processing
" the echo message far too frequently.
if l:pos != s:last_pos
+ let l:delay = ale#Var(bufnr(''), 'echo_delay')
+
let s:last_pos = l:pos
- let s:cursor_timer = timer_start(10, function('ale#cursor#EchoCursorWarning'))
+ let s:cursor_timer = timer_start(
+ \ l:delay,
+ \ function('ale#cursor#EchoCursorWarning')
+ \)
endif
endfunction
diff --git a/doc/ale.txt b/doc/ale.txt
index 817191f5..1e6b396d 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -541,6 +541,18 @@ g:ale_echo_cursor *g:ale_echo_cursor*
The format of the message can be customizable in |g:ale_echo_msg_format|.
+g:ale_echo_delay *g:ale_echo_delay*
+ *b:ale_echo_delay*
+ Type: |Number|
+ Default: `10`
+
+ Given any integer, this option controls the number of milliseconds before
+ ALE will echo a message for a problem near the cursor.
+
+ The value can be increased to decrease the amount of processing ALE will do
+ for files displaying a large number of problems.
+
+
g:ale_echo_msg_error_str *g:ale_echo_msg_error_str*
Type: |String|
diff --git a/plugin/ale.vim b/plugin/ale.vim
index 2f188d2d..9fac75ee 100644
--- a/plugin/ale.vim
+++ b/plugin/ale.vim
@@ -155,6 +155,8 @@ let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning')
" This flag can be set to 0 to disable echoing when the cursor moves.
let g:ale_echo_cursor = get(g:, 'ale_echo_cursor', 1)
+" Controls the milliseconds delay before echoing a message.
+let g:ale_echo_delay = get(g:, 'ale_echo_delay', 10)
" This flag can be set to 0 to disable balloon support.
call ale#Set('set_balloons', has('balloon_eval'))