#965 Check ale#ShouldDoNothing() less and such often, for better performance
This commit is contained in:
parent
be547a0111
commit
02c8793c53
@ -3,15 +3,6 @@
|
|||||||
|
|
||||||
let s:cursor_timer = -1
|
let s:cursor_timer = -1
|
||||||
let s:last_pos = [0, 0, 0]
|
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
|
" Return a formatted message according to g:ale_echo_msg_format variable
|
||||||
function! s:GetMessage(linter, type, text) abort
|
function! s:GetMessage(linter, type, text) abort
|
||||||
@ -84,12 +75,12 @@ function! ale#cursor#EchoCursorWarning(...) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:EchoImpl() abort
|
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
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Only echo the warnings in normal mode, otherwise we will get problems.
|
if ale#ShouldDoNothing(bufnr(''))
|
||||||
if mode() isnot# 'n'
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -108,15 +99,8 @@ function! s:EchoImpl() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#cursor#EchoCursorWarningWithDelay() abort
|
function! ale#cursor#EchoCursorWarningWithDelay() abort
|
||||||
return ale#CallWithCooldown(
|
" Only echo the warnings in normal mode, otherwise we will get problems.
|
||||||
\ 'dont_echo_with_delay_until',
|
if mode() isnot# 'n'
|
||||||
\ function('s:EchoWithDelayImpl'),
|
|
||||||
\ [],
|
|
||||||
\)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:EchoWithDelayImpl() abort
|
|
||||||
if ale#ShouldDoNothing(bufnr(''))
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -135,12 +119,12 @@ function! s:EchoWithDelayImpl() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#cursor#ShowCursorDetail() abort
|
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
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Only echo the warnings in normal mode, otherwise we will get problems.
|
if ale#ShouldDoNothing(bufnr(''))
|
||||||
if mode() isnot# 'n'
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -17,10 +17,6 @@ Execute(ALE should stop linting for a while after exceptions are thrown):
|
|||||||
AssertThrows call ale#Lint()
|
AssertThrows call ale#Lint()
|
||||||
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):
|
Execute(ALE should stop echoing messages for a while after exceptions are thrown):
|
||||||
AssertThrows call ale#cursor#EchoCursorWarning()
|
AssertThrows call ale#cursor#EchoCursorWarning()
|
||||||
call ale#cursor#EchoCursorWarning()
|
call ale#cursor#EchoCursorWarning()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user