diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-14 23:25:01 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-14 23:25:01 +0000 |
commit | d48506f9c17915a72ff773f11728958e723e9e92 (patch) | |
tree | fc44c676d4909c33564ec27499066e3d66ca6109 /autoload | |
parent | 6b2c61a5cc59d61270266dbe399d5dc55cfad5b4 (diff) | |
download | ale-d48506f9c17915a72ff773f11728958e723e9e92.zip |
Fix #757 - Show :ALEDetail messages in a window
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/cursor.vim | 6 | ||||
-rw-r--r-- | autoload/ale/preview.vim | 18 |
2 files changed, 20 insertions, 4 deletions
diff --git a/autoload/ale/cursor.vim b/autoload/ale/cursor.vim index 1980c194..69076102 100644 --- a/autoload/ale/cursor.vim +++ b/autoload/ale/cursor.vim @@ -125,9 +125,7 @@ function! ale#cursor#ShowCursorDetail() abort if !empty(l:loc) let l:message = get(l:loc, 'detail', l:loc.text) - call s:EchoWithShortMess('off', l:message) - - " Set the echo marker, so we can clear it by moving the cursor. - let l:info.echoed = 1 + call ale#preview#Show(split(l:message, "\n")) + echo endif endfunction diff --git a/autoload/ale/preview.vim b/autoload/ale/preview.vim new file mode 100644 index 00000000..3b1c16a6 --- /dev/null +++ b/autoload/ale/preview.vim @@ -0,0 +1,18 @@ +" Author: w0rp <devw0rp@gmail.com> +" Description: Preview windows for showing whatever information in. + +" Open a preview window and show some lines in it. +function! ale#preview#Show(lines) abort + silent pedit ALEPreviewWindow + wincmd P + setlocal modifiable + setlocal noreadonly + setlocal nobuflisted + setlocal filetype=ale-preview + setlocal buftype=nofile + setlocal bufhidden=wipe + :%d + call setline(1, a:lines) + setlocal nomodifiable + setlocal readonly +endfunction |