summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2016-10-08 18:04:34 +0100
committerw0rp <devw0rp@gmail.com>2016-10-08 18:04:34 +0100
commit57b157bbae7e8fb60a74680f9c435b5bdd53ed1b (patch)
tree37933e4a3b6168c99cc972452f6da260b76cf50b /plugin
parentaf8df256c07cd443beee0e645277d759a3276c74 (diff)
downloadale-57b157bbae7e8fb60a74680f9c435b5bdd53ed1b.zip
Use shortmess for shortening long echo lines instead.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ale/cursor.vim15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugin/ale/cursor.vim b/plugin/ale/cursor.vim
index 7ebdbf1c..1fc0d70d 100644
--- a/plugin/ale/cursor.vim
+++ b/plugin/ale/cursor.vim
@@ -49,10 +49,17 @@ function! ale#cursor#TruncatedEcho(message)
" Remove any newlines in the message.
let message = substitute(message, "\n", '', 'g')
- let truncated_message = join(split(message, '\zs')[:&columns - 2], '')
-
- " Echo the message truncated to fit without creating a prompt.
- echo truncated_message
+ " 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.
+ set shortmess+=T
+ exec "norm :echomsg message\n"
+ finally
+ let &shortmess = shortmess_options
+ endtry
endfunction
function! ale#cursor#EchoCursorWarning(...)