Get tests to pass in Vim 8.1

This commit is contained in:
w0rp
2018-07-23 20:41:06 +01:00
parent 11339ca730
commit d9579dbbe9
20 changed files with 150 additions and 104 deletions

View File

@@ -34,26 +34,25 @@ function! ale#balloon#Expr() abort
endfunction
function! ale#balloon#Disable() abort
if has('balloon_eval_term')
set noballoonevalterm
if has('balloon_eval')
set noballooneval
set balloonexpr=
endif
set noballooneval
set balloonexpr=
if has('balloon_eval_term')
set noballoonevalterm
set balloonexpr=
endif
endfunction
function! ale#balloon#Enable() abort
if !has('balloon_eval') && !has('balloon_eval_term')
return
endif
if has('balloon_eval')
set ballooneval
set balloonexpr=ale#balloon#Expr()
endif
if has('balloon_eval_term')
set balloonevalterm
set balloonexpr=ale#balloon#Expr()
endif
set balloonexpr=ale#balloon#Expr()
endfunction

View File

@@ -52,3 +52,26 @@ function! ale#test#SetFilename(path) abort
silent! noautocmd execute 'file ' . fnameescape(ale#path#Simplify(l:full_path))
endfunction
function! s:RemoveModule(results) abort
for l:item in a:results
if has_key(l:item, 'module')
call remove(l:item, 'module')
endif
endfor
endfunction
" Return loclist data without the module string, only in newer Vim versions.
function! ale#test#GetLoclistWithoutModule() abort
let l:results = getloclist(0)
call s:RemoveModule(l:results)
return l:results
endfunction
function! ale#test#GetQflistWithoutModule() abort
let l:results = getqflist()
call s:RemoveModule(l:results)
return l:results
endfunction

View File

@@ -43,7 +43,7 @@ function! ale#toggle#Toggle() abort
call s:CleanupEveryBuffer()
call s:DisablePostamble()
if has('balloon_eval')
if exists('*ale#balloon#Disable')
call ale#balloon#Disable()
endif
endif