Fix #373 - echo the cursor message after lint cycles or when leaving Insert mode
This commit is contained in:
parent
fab9e8f5ea
commit
0e50a7d278
3 changed files with 49 additions and 0 deletions
|
@ -36,7 +36,16 @@ Before:
|
|||
\ },
|
||||
\}
|
||||
|
||||
" Turn off other features, we only care about this one feature in this test.
|
||||
let g:ale_set_loclist = 0
|
||||
let g:ale_set_signs = 0
|
||||
let g:ale_set_highlights = 0
|
||||
|
||||
After:
|
||||
let g:ale_set_loclist = 1
|
||||
let g:ale_set_signs = 1
|
||||
let g:ale_set_highlights = 1
|
||||
|
||||
unlet! g:output
|
||||
unlet! g:lines
|
||||
let g:ale_buffer_info = {}
|
||||
|
@ -84,3 +93,33 @@ Then(Check the cursor output):
|
|||
let g:lines = split(g:output, "\n")
|
||||
|
||||
AssertEqual 'Missing radix parameter (radix)', g:lines[-1]
|
||||
|
||||
Execute(Set results for a lint cycle, with the cursor on line 1):
|
||||
:1
|
||||
call ale#engine#SetResults(
|
||||
\ bufnr('%'),
|
||||
\ g:ale_buffer_info[bufnr('%')].loclist,
|
||||
\)
|
||||
|
||||
Then(Check the cursor output):
|
||||
redir => g:output
|
||||
:mess
|
||||
redir END
|
||||
|
||||
let g:lines = split(g:output, "\n")
|
||||
|
||||
AssertEqual 'Missing semicolon. (semi)', g:lines[-1]
|
||||
|
||||
Execute(Simulate leaving insert mode on line 2):
|
||||
:2
|
||||
normal 16h
|
||||
doautocmd InsertLeave
|
||||
|
||||
Then(Check the cursor output):
|
||||
redir => g:output
|
||||
:mess
|
||||
redir END
|
||||
|
||||
let g:lines = split(g:output, "\n")
|
||||
|
||||
AssertEqual 'Infix operators must be spaced. (space-infix-ops)', g:lines[-1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue