Close #3274 - Handle basic LSP markdown formatting

This commit is contained in:
w0rp
2020-08-12 22:11:33 +01:00
parent d5912b53dd
commit 7c4b1d8444
5 changed files with 360 additions and 52 deletions

View File

@@ -16,7 +16,9 @@ endfunction
" Vim 8 does not support echoing long messages from asynchronous callbacks,
" but NeoVim does. Small messages can be echoed in Vim 8, and larger messages
" have to be shown in preview windows.
function! ale#util#ShowMessage(string) abort
function! ale#util#ShowMessage(string, ...) abort
let l:options = get(a:000, 0, {})
if !has('nvim')
call ale#preview#CloseIfTypeMatches('ale-preview.message')
endif
@@ -25,10 +27,13 @@ function! ale#util#ShowMessage(string) abort
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,
\})
call ale#preview#Show(split(a:string, "\n"), extend(
\ {
\ 'filetype': 'ale-preview.message',
\ 'stay_here': 1,
\ },
\ l:options,
\))
endif
endfunction