#1524 Do not try to check buffers with empty filetypes

This commit is contained in:
w0rp
2018-05-28 17:38:14 +01:00
parent ce89d93e1c
commit 18509195f5
9 changed files with 49 additions and 5 deletions
@@ -26,6 +26,7 @@ After:
unlet! b:funky_command_created
Given foobar(An empty file):
Execute(ALE shouldn't do much of anything for ctrlp-funky buffers):
Assert !ale#ShouldDoNothing(bufnr('')), 'The preliminary check failed'
@@ -43,6 +44,16 @@ Execute(ALE shouldn't try to check buffers with '.' as the filename):
Assert ale#ShouldDoNothing(bufnr(''))
Execute(DoNothing should return 0 when the filetype is empty):
AssertEqual
\ 0,
\ ale#ShouldDoNothing(bufnr('')),
\ 'ShouldDoNothing() was 1 for some other reason'
set filetype=
AssertEqual 1, ale#ShouldDoNothing(bufnr(''))
Execute(The DoNothing check should work if the ALE globals aren't defined):
unlet! g:ale_filetype_blacklist
unlet! g:ale_maximum_file_size