mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-28 12:32:27 +08:00
#468 - Do not try to echo things for a while if something goes wrong
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Echoes lint message for the current line, if any
|
||||
|
||||
let s:cursor_timer = -1
|
||||
let s:last_pos = [0, 0, 0]
|
||||
let s:error_delay_ms = 1000 * 60 * 2
|
||||
|
||||
if !exists('s:dont_queue_until')
|
||||
let s:dont_queue_until = -1
|
||||
endif
|
||||
|
||||
if !exists('s:dont_echo_until')
|
||||
let s:dont_echo_until = -1
|
||||
endif
|
||||
|
||||
" Return a formatted message according to g:ale_echo_msg_format variable
|
||||
function! s:GetMessage(linter, type, text) abort
|
||||
let l:msg = g:ale_echo_msg_format
|
||||
@@ -67,6 +79,10 @@ function! s:StopCursorTimer() abort
|
||||
endfunction
|
||||
|
||||
function! ale#cursor#EchoCursorWarning(...) abort
|
||||
return ale#CallWithCooldown('dont_echo_until', function('s:EchoImpl'), [])
|
||||
endfunction
|
||||
|
||||
function! s:EchoImpl() abort
|
||||
if ale#ShouldDoNothing(bufnr(''))
|
||||
return
|
||||
endif
|
||||
@@ -90,10 +106,15 @@ function! ale#cursor#EchoCursorWarning(...) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:cursor_timer = -1
|
||||
let s:last_pos = [0, 0, 0]
|
||||
|
||||
function! ale#cursor#EchoCursorWarningWithDelay() abort
|
||||
return ale#CallWithCooldown(
|
||||
\ 'dont_echo_with_delay_until',
|
||||
\ function('s:EchoWithDelayImpl'),
|
||||
\ [],
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! s:EchoWithDelayImpl() abort
|
||||
if ale#ShouldDoNothing(bufnr(''))
|
||||
return
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user