diff src/message.c @ 16393:c1c25e2523a6 v8.1.1201

patch 8.1.1201: output of :command is hard to read commit https://github.com/vim/vim/commit/725310d89e1ba268bf410472b7de054c6c260161 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 24 23:08:23 2019 +0200 patch 8.1.1201: output of :command is hard to read Problem: Output of :command is hard to read. Solution: Make some columns wider, some narrower. Truncate the command when listing all.
author Bram Moolenaar <Bram@vim.org>
date Wed, 24 Apr 2019 23:15:05 +0200
parents 78faa25f9698
children 7ae2396cef62
line wrap: on
line diff
--- 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);