#1875 Do not lint and so on when an operator is pending
This commit is contained in:
parent
a746ea2bfc
commit
fddbfdef12
@ -62,6 +62,11 @@ function! ale#ShouldDoNothing(buffer) abort
|
|||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Don't start linting and so on when an operator is pending.
|
||||||
|
if ale#util#Mode(1) is# 'no'
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
" Do nothing if running in the sandbox.
|
" Do nothing if running in the sandbox.
|
||||||
if ale#util#InSandbox()
|
if ale#util#InSandbox()
|
||||||
return 1
|
return 1
|
||||||
|
@ -4,10 +4,18 @@ Before:
|
|||||||
Save g:ale_enabled
|
Save g:ale_enabled
|
||||||
Save &l:statusline
|
Save &l:statusline
|
||||||
|
|
||||||
|
let b:fake_mode = 'n'
|
||||||
|
|
||||||
call ale#test#SetDirectory('/testplugin/test')
|
call ale#test#SetDirectory('/testplugin/test')
|
||||||
|
|
||||||
let b:funky_command_created = 0
|
let b:funky_command_created = 0
|
||||||
|
|
||||||
|
runtime autoload/ale/util.vim
|
||||||
|
|
||||||
|
function! ale#util#Mode(...) abort
|
||||||
|
return b:fake_mode
|
||||||
|
endfunction
|
||||||
|
|
||||||
" We will test for the existence of this command, so create one if needed.
|
" We will test for the existence of this command, so create one if needed.
|
||||||
if !exists(':CtrlPFunky')
|
if !exists(':CtrlPFunky')
|
||||||
command CtrlPFunky echo
|
command CtrlPFunky echo
|
||||||
@ -25,6 +33,9 @@ After:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
unlet! b:funky_command_created
|
unlet! b:funky_command_created
|
||||||
|
unlet! b:fake_mode
|
||||||
|
|
||||||
|
runtime autoload/ale/util.vim
|
||||||
|
|
||||||
Given foobar(An empty file):
|
Given foobar(An empty file):
|
||||||
Execute(ALE shouldn't do much of anything for ctrlp-funky buffers):
|
Execute(ALE shouldn't do much of anything for ctrlp-funky buffers):
|
||||||
@ -44,7 +55,7 @@ Execute(ALE shouldn't try to check buffers with '.' as the filename):
|
|||||||
|
|
||||||
Assert ale#ShouldDoNothing(bufnr(''))
|
Assert ale#ShouldDoNothing(bufnr(''))
|
||||||
|
|
||||||
Execute(DoNothing should return 0 when the filetype is empty):
|
Execute(DoNothing should return 1 when the filetype is empty):
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ 0,
|
\ 0,
|
||||||
\ ale#ShouldDoNothing(bufnr('')),
|
\ ale#ShouldDoNothing(bufnr('')),
|
||||||
@ -54,6 +65,11 @@ Execute(DoNothing should return 0 when the filetype is empty):
|
|||||||
|
|
||||||
AssertEqual 1, ale#ShouldDoNothing(bufnr(''))
|
AssertEqual 1, ale#ShouldDoNothing(bufnr(''))
|
||||||
|
|
||||||
|
Execute(DoNothing should return 1 when an operator is pending):
|
||||||
|
let b:fake_mode = 'no'
|
||||||
|
|
||||||
|
AssertEqual 1, ale#ShouldDoNothing(bufnr(''))
|
||||||
|
|
||||||
Execute(The DoNothing check should work if the ALE globals aren't defined):
|
Execute(The DoNothing check should work if the ALE globals aren't defined):
|
||||||
unlet! g:ale_filetype_blacklist
|
unlet! g:ale_filetype_blacklist
|
||||||
unlet! g:ale_maximum_file_size
|
unlet! g:ale_maximum_file_size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user