summaryrefslogtreecommitdiff
path: root/src/message.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-04-24 23:08:23 +0200
committerBram Moolenaar <Bram@vim.org>2019-04-24 23:08:23 +0200
commit725310d89e1ba268bf410472b7de054c6c260161 (patch)
tree821ec66709f77619bf8a8b8051f640496f8e90d4 /src/message.c
parent31fc39e47b3cc5e9ef4fa05943d42a4fb22de55e (diff)
downloadvim-git-725310d89e1ba268bf410472b7de054c6c260161.tar.gz
patch 8.1.1201: output of :command is hard to readv8.1.1201
Problem: Output of :command is hard to read. Solution: Make some columns wider, some narrower. Truncate the command when listing all.
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/message.c b/src/message.c
index fa37df12b..e18f95269 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1594,7 +1594,8 @@ msg_make(char_u *arg)
int
msg_outtrans_special(
char_u *strstart,
- int from) /* TRUE for lhs of a mapping */
+ int from, // TRUE for lhs of a mapping
+ int maxlen) // screen columns, 0 for unlimeted
{
char_u *str = strstart;
int retval = 0;
@@ -1614,6 +1615,8 @@ msg_outtrans_special(
else
text = (char *)str2special(&str, from);
len = vim_strsize((char_u *)text);
+ if (maxlen > 0 && retval + len >= maxlen)
+ break;
/* Highlight special keys */
msg_puts_attr(text, len > 1
&& (*mb_ptr2len)((char_u *)text) <= 1 ? attr : 0);