mirror of
https://github.com/dense-analysis/ale.git
synced 2026-03-05 14:44:24 +08:00
Stop the no loclist clearing test from failing in NeoVim 0.3
This commit is contained in:
@@ -1,31 +1,11 @@
|
|||||||
Before:
|
Before:
|
||||||
Save g:ale_run_synchronously
|
Save g:ale_buffer_info
|
||||||
|
|
||||||
let g:ale_run_synchronously = 1
|
call ale#linter#Reset()
|
||||||
|
|
||||||
function! TestCallback(buffer, output)
|
|
||||||
return [
|
|
||||||
\ {
|
|
||||||
\ 'lnum': 1,
|
|
||||||
\ 'text': 'Something is wrong',
|
|
||||||
\ },
|
|
||||||
\]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('foobar', {
|
|
||||||
\ 'name': 'testlinter',
|
|
||||||
\ 'callback': 'TestCallback',
|
|
||||||
\ 'executable': has('win32') ? 'cmd' : 'true',
|
|
||||||
\ 'command': 'true',
|
|
||||||
\ 'read_buffer': 0,
|
|
||||||
\})
|
|
||||||
|
|
||||||
After:
|
After:
|
||||||
Restore
|
Restore
|
||||||
|
|
||||||
delfunction TestCallback
|
|
||||||
let g:ale_buffer_info = {}
|
|
||||||
call ale#linter#Reset()
|
|
||||||
call setloclist(0, [])
|
call setloclist(0, [])
|
||||||
call clearmatches()
|
call clearmatches()
|
||||||
sign unplace *
|
sign unplace *
|
||||||
@@ -34,10 +14,11 @@ Given foobar (Some file):
|
|||||||
abc
|
abc
|
||||||
|
|
||||||
Execute(The loclist shouldn't be cleared when opening the loclist):
|
Execute(The loclist shouldn't be cleared when opening the loclist):
|
||||||
call ale#Lint()
|
call ale#engine#InitBufferInfo(bufnr(''))
|
||||||
sleep 1ms
|
let g:ale_buffer_info[bufnr('')].loclist = [
|
||||||
|
\ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2},
|
||||||
AssertEqual 1, len(getloclist(0)), 'The loclist was never set'
|
\]
|
||||||
|
call setloclist(0, g:ale_buffer_info[bufnr('')].loclist)
|
||||||
|
|
||||||
" The cleanup function is called when the loclist window is closed.
|
" The cleanup function is called when the loclist window is closed.
|
||||||
" If some cleanup is done for this buffer, for which nothing is wrong,
|
" If some cleanup is done for this buffer, for which nothing is wrong,
|
||||||
|
|||||||
Reference in New Issue
Block a user