Fix #1404 - Do not show balloons when g:ale_set_balloons is 0. Add b:ale_set_balloons

This commit is contained in:
w0rp
2018-03-25 12:57:08 +01:00
parent 107516c757
commit 164c711b3d
5 changed files with 107 additions and 17 deletions

View File

@@ -2,6 +2,13 @@
" Description: balloonexpr support for ALE.
function! ale#balloon#MessageForPos(bufnr, lnum, col) abort
" Don't show balloons if they are disabled, or linting is disabled.
if !ale#Var(a:bufnr, 'set_balloons')
\|| !g:ale_enabled
\|| !getbufvar(a:bufnr, 'ale_enabled', 1)
return ''
endif
let l:loclist = get(g:ale_buffer_info, a:bufnr, {'loclist': []}).loclist
let l:index = ale#util#BinarySearch(l:loclist, a:bufnr, a:lnum, a:col)
@@ -13,7 +20,7 @@ function! ale#balloon#Expr() abort
endfunction
function! ale#balloon#Disable() abort
set noballooneval
set noballooneval balloonexpr=
endfunction
function! ale#balloon#Enable() abort