mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
Use shortmess for shortening long echo lines instead.
This commit is contained in:
@@ -49,10 +49,17 @@ function! ale#cursor#TruncatedEcho(message)
|
|||||||
" Remove any newlines in the message.
|
" Remove any newlines in the message.
|
||||||
let message = substitute(message, "\n", '', 'g')
|
let message = substitute(message, "\n", '', 'g')
|
||||||
|
|
||||||
let truncated_message = join(split(message, '\zs')[:&columns - 2], '')
|
" We need to turn T for truncated messages on for shortmess,
|
||||||
|
" and then then we need to reset the option back to what it was.
|
||||||
|
let shortmess_options = &shortmess
|
||||||
|
|
||||||
|
try
|
||||||
" Echo the message truncated to fit without creating a prompt.
|
" Echo the message truncated to fit without creating a prompt.
|
||||||
echo truncated_message
|
set shortmess+=T
|
||||||
|
exec "norm :echomsg message\n"
|
||||||
|
finally
|
||||||
|
let &shortmess = shortmess_options
|
||||||
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#cursor#EchoCursorWarning(...)
|
function! ale#cursor#EchoCursorWarning(...)
|
||||||
|
|||||||
Reference in New Issue
Block a user