Fix #773 - Do not clear the loclist when closing the loclist window
This commit is contained in:
parent
507e32e91c
commit
cad9fc19c6
@ -665,6 +665,10 @@ endfunction
|
|||||||
" clear the state of everything, and remove the Dictionary for managing
|
" clear the state of everything, and remove the Dictionary for managing
|
||||||
" the buffer.
|
" the buffer.
|
||||||
function! ale#engine#Cleanup(buffer) abort
|
function! ale#engine#Cleanup(buffer) abort
|
||||||
|
if !has_key(g:ale_buffer_info, a:buffer)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
call ale#engine#RunLinters(a:buffer, [], 1)
|
call ale#engine#RunLinters(a:buffer, [], 1)
|
||||||
|
|
||||||
call remove(g:ale_buffer_info, a:buffer)
|
call remove(g:ale_buffer_info, a:buffer)
|
||||||
|
@ -55,7 +55,7 @@ let g:ale_buffer_info = {}
|
|||||||
|
|
||||||
" This option prevents ALE autocmd commands from being run for particular
|
" This option prevents ALE autocmd commands from being run for particular
|
||||||
" filetypes which can cause issues.
|
" filetypes which can cause issues.
|
||||||
let g:ale_filetype_blacklist = ['nerdtree', 'unite', 'tags']
|
let g:ale_filetype_blacklist = ['nerdtree', 'unite', 'tags', 'qf']
|
||||||
|
|
||||||
" This Dictionary configures which linters are enabled for which languages.
|
" This Dictionary configures which linters are enabled for which languages.
|
||||||
let g:ale_linters = get(g:, 'ale_linters', {})
|
let g:ale_linters = get(g:, 'ale_linters', {})
|
||||||
|
45
test/test_results_not_cleared_when_opening_loclist.vader
Normal file
45
test/test_results_not_cleared_when_opening_loclist.vader
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
Before:
|
||||||
|
Save g:ale_run_synchronously
|
||||||
|
|
||||||
|
let g:ale_run_synchronously = 1
|
||||||
|
|
||||||
|
function! TestCallback(buffer, output)
|
||||||
|
return [
|
||||||
|
\ {
|
||||||
|
\ 'lnum': 1,
|
||||||
|
\ 'text': 'Something is wrong',
|
||||||
|
\ },
|
||||||
|
\]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('foobar', {
|
||||||
|
\ 'name': 'testlinter',
|
||||||
|
\ 'callback': 'TestCallback',
|
||||||
|
\ 'executable': 'true',
|
||||||
|
\ 'command': 'true',
|
||||||
|
\ 'read_buffer': 0,
|
||||||
|
\})
|
||||||
|
|
||||||
|
After:
|
||||||
|
Restore
|
||||||
|
|
||||||
|
delfunction TestCallback
|
||||||
|
let g:ale_buffer_info = {}
|
||||||
|
call ale#linter#Reset()
|
||||||
|
|
||||||
|
Given foobar (Some file):
|
||||||
|
abc
|
||||||
|
|
||||||
|
Execute(The loclist shouldn't be cleared when opening the loclist):
|
||||||
|
call ale#Lint()
|
||||||
|
|
||||||
|
AssertEqual 1, len(getloclist(0))
|
||||||
|
|
||||||
|
" The cleanup function is called when the loclist window is closed.
|
||||||
|
" If some cleanup is done for this buffer, for which nothing is wrong,
|
||||||
|
" then the loclist for the window, which is the same window as the window
|
||||||
|
" we are checking, will be cleared.
|
||||||
|
:lopen
|
||||||
|
:q
|
||||||
|
|
||||||
|
AssertEqual 1, len(getloclist(0))
|
Loading…
Reference in New Issue
Block a user