diff --git a/autoload/ale/cursor.vim b/autoload/ale/cursor.vim index 3479603e..c83bbcb6 100644 --- a/autoload/ale/cursor.vim +++ b/autoload/ale/cursor.vim @@ -11,9 +11,9 @@ let g:ale_echo_msg_format = get(g:, 'ale_echo_msg_format', '%code: %%s') let s:cursor_timer = -1 " A wrapper for echon so we can test messages we echo in Vader tests. -function! ale#cursor#Echon(message) abort +function! ale#cursor#Echom(message) abort " no-custom-checks - echon a:message + exec "norm! :echom a:message\n" endfunction function! ale#cursor#TruncatedEcho(original_message) abort @@ -36,14 +36,7 @@ function! ale#cursor#TruncatedEcho(original_message) abort silent! setlocal shortmess+=T try - " echon will not display the message if it exceeds the width of - " the window - if &columns < strdisplaywidth(l:message) - " Truncate message longer than window width with trailing '...' - let l:message = l:message[:&columns - 5] . '...' - endif - - call ale#cursor#Echon(l:message) + call ale#cursor#Echom(l:message) catch /^Vim\%((\a\+)\)\=:E523/ " Fallback into manual truncate (#1987) let l:winwidth = winwidth(0) diff --git a/autoload/ale/hover.vim b/autoload/ale/hover.vim index a738c848..5b14df8c 100644 --- a/autoload/ale/hover.vim +++ b/autoload/ale/hover.vim @@ -231,7 +231,11 @@ function! ale#hover#HandleLSPResponse(conn_id, response) abort \&& (l:set_balloons is 1 || l:set_balloons is# 'hover') call balloon_show(join(l:lines, "\n")) elseif get(l:options, 'truncated_echo', 0) - call ale#cursor#TruncatedEcho(join(l:lines[0], '\n')) + if type(l:lines[0]) is# v:t_list + call ale#cursor#TruncatedEcho(join(l:lines[0], '\n')) + else + call ale#cursor#TruncatedEcho(l:lines[0]) + endif elseif g:ale_hover_to_floating_preview || g:ale_floating_preview call ale#floating_preview#Show(l:lines, { \ 'filetype': 'ale-preview.message', diff --git a/test/test_cursor_warnings.vader b/test/test_cursor_warnings.vader index f1f1781c..b767d225 100644 --- a/test/test_cursor_warnings.vader +++ b/test/test_cursor_warnings.vader @@ -89,7 +89,7 @@ Before: let g:last_message = '' - function! ale#cursor#Echon(message) abort + function! ale#cursor#Echom(message) abort let g:last_message = a:message endfunction