diff options
author | w0rp <devw0rp@gmail.com> | 2017-10-11 23:51:36 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-10-11 23:51:41 +0100 |
commit | 02c8793c533dccf4b2f13d998135c9b8d7a944fd (patch) | |
tree | 2b833de4d80ec14d716a44694eaafa6af38ef76a /autoload | |
parent | be547a0111c67473f69dec93d59cb071322b05c5 (diff) | |
download | ale-02c8793c533dccf4b2f13d998135c9b8d7a944fd.zip |
#965 Check ale#ShouldDoNothing() less and such often, for better performance
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/cursor.vim | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/autoload/ale/cursor.vim b/autoload/ale/cursor.vim index 340432f7..f5394a43 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 |