diff --git a/autoload/ale/cursor.vim b/autoload/ale/cursor.vim index 340432f..f5394a4 100644 --- a/autoload/ale/cursor.vim +++ b/autoload/ale/cursor.vim @@ -3,15 +3,6 @@ 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 @@ -84,12 +75,12 @@ function! ale#cursor#EchoCursorWarning(...) abort endfunction function! s:EchoImpl() abort - if ale#ShouldDoNothing(bufnr('')) + " Only echo the warnings in normal mode, otherwise we will get problems. + if mode() isnot# 'n' return endif - " Only echo the warnings in normal mode, otherwise we will get problems. - if mode() isnot# 'n' + if ale#ShouldDoNothing(bufnr('')) return endif @@ -108,15 +99,8 @@ function! s:EchoImpl() abort endfunction 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('')) + " Only echo the warnings in normal mode, otherwise we will get problems. + if mode() isnot# 'n' return endif @@ -135,12 +119,12 @@ function! s:EchoWithDelayImpl() abort endfunction function! ale#cursor#ShowCursorDetail() abort - if ale#ShouldDoNothing(bufnr('')) + " Only echo the warnings in normal mode, otherwise we will get problems. + if mode() isnot# 'n' return endif - " Only echo the warnings in normal mode, otherwise we will get problems. - if mode() isnot# 'n' + if ale#ShouldDoNothing(bufnr('')) return endif diff --git a/test/test_lint_error_delay.vader b/test/test_lint_error_delay.vader index 4c7f094..7f08179 100644 --- a/test/test_lint_error_delay.vader +++ b/test/test_lint_error_delay.vader @@ -17,10 +17,6 @@ Execute(ALE should stop linting for a while after exceptions are thrown): AssertThrows call ale#Lint() call ale#Lint() -Execute(ALE should stop queuing echo messages for a while after exceptions are thrown): - AssertThrows call ale#cursor#EchoCursorWarningWithDelay() - call ale#cursor#EchoCursorWarningWithDelay() - Execute(ALE should stop echoing messages for a while after exceptions are thrown): AssertThrows call ale#cursor#EchoCursorWarning() call ale#cursor#EchoCursorWarning()