#697 - Clear all highlights every time items are set again, and refactor most things. Clear errors when linters are removed

This commit is contained in:
w0rp
2017-07-07 23:47:41 +01:00
parent 46225f3bb1
commit 8eb4f95766
14 changed files with 274 additions and 212 deletions

View File

@@ -69,6 +69,10 @@ Before:
\ 'read_buffer': 0,
\})
let g:filename = tempname()
call writefile([], g:filename)
call ale#test#SetFilename(g:filename)
After:
Restore
@@ -79,6 +83,12 @@ After:
delfunction LintFileCallback
delfunction BufferCallback
if filereadable(g:filename)
call delete(g:filename)
endif
unlet g:filename
Given foobar (Some imaginary filetype):
foo
bar
@@ -107,6 +117,9 @@ Execute(Running linters without 'lint_file' should run only buffer linters):
Execute(Running linters with 'lint_file' should run all linters):
call ale#ResetLintFileMarkers()
let g:ale_buffer_info = {}
Assert filereadable(expand('%:p')), 'The file was not readable'
call ale#Queue(0, 'lint_file')
AssertEqual [
@@ -139,6 +152,9 @@ Execute(Running linters with 'lint_file' should run all linters):
Execute(Linter errors from files should be kept):
call ale#ResetLintFileMarkers()
let g:ale_buffer_info = {}
Assert filereadable(expand('%:p')), 'The file was not readable'
call ale#Queue(0, 'lint_file')
" Change the results for the buffer callback.