-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Using the popup feature you can get a balloon like experience without having to use the mouse.
A proof of concept patch is below, but I'm not experienced enough in either vimscript or ale's code specifically to provide a fully fleshed out PR.
diff --git autoload/ale/cursor.vim autoload/ale/cursor.vim
index 8c331c5..edb99e2 100644
--- autoload/ale/cursor.vim
+++ autoload/ale/cursor.vim
@@ -136,8 +136,7 @@ function! s:ShowCursorDetailForItem(loc, options) abort
let s:last_detailed_line = line('.')
let l:message = get(a:loc, 'detail', a:loc.text)
- let l:lines = split(l:message, "\n")
- call ale#preview#Show(l:lines, {'stay_here': l:stay_here})
+ call ale#util#ShowMessage(l:message)
" Clear the echo message if we manually displayed details.
if !l:stay_here
diff --git autoload/ale/util.vim autoload/ale/util.vim
index 99cd856..cf46136 100644
--- autoload/ale/util.vim
+++ autoload/ale/util.vim
@@ -21,15 +21,7 @@ function! ale#util#ShowMessage(string) abort
call ale#preview#CloseIfTypeMatches('ale-preview.message')
endif
- " We have to assume the user is using a monospace font.
- if has('nvim') || (a:string !~? "\n" && len(a:string) < &columns)
- execute 'echo a:string'
- else
- call ale#preview#Show(split(a:string, "\n"), {
- \ 'filetype': 'ale-preview.message',
- \ 'stay_here': 1,
- \})
- endif
+ call popup_atcursor(split(a:string, "\n"), {'border':[], 'moved': 'any'})
endfunction
" A wrapper function for execute, so we can test executing some commands.ian-howell, jussi-kalliokoski, jcmorrow, felixwoolford, vishes-shell and 2 more