Open tsony-tsonev opened 5 years ago
The following work around works but it is quite ugly:
let l:loclist = get(g:ale_buffer_info, v:beval_bufnr, {'loclist': []}).loclist
let l:index = ale#util#BinarySearch(l:loclist, v:beval_bufnr, v:beval_lnum, v:beval_col)
if l:index >= 0
return l:loclist[l:index].text
endif
basically the same thing from the method just replacing a:bufnr, a:lnum, a:col
with v:beval_bufnr, v:beval_lnum, v:beval_col
Avoiding breaking changes is always my top priority. I think the general idea here is good. I'm happy to document ale#balloon#MessageForPos(bufnr, lnum, col)
as a public part of ALE's API. I think we should preserve the existing behaviour and support the new use case by implementing support for setting g:ale_set_balloons
to a value like 'custom_balloonexpr'
, or whatever String makes sense.
It's important that users be able to disable balloons while ALE is running, without resetting balloonexpr
, by setting g:ale_set_balloons
or b:ale_set_balloons
to 0
, primarily for supporting the buffer variable version with ftplugin file settings.
These days many projects support balloons which is awesome, but they are all overriding the
set balloonexpr=...
for example:vim-go - go#tool#DescribeBalloon()
ale - ale#balloon#Expr()
also I have my own custom balloon logic for previewing folds.It would be nice if
ale#balloon#MessageForPos
can return messages without checkinglet g:ale_set_balloons = 1
because it will override theset balloonexpr=...
(maybe some other variable can be introduced)This way we'll be able to write our own balloonexpr func and choose when to show contents of folds, when linter warnings and when golang definitons.