vim-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.
725310d89e
This commit is contained in:
Jan Edmund Lazo
2019-10-30 00:56:49 -04:00
parent 986eafce47
commit 7955c05acc
6 changed files with 80 additions and 43 deletions

View File

@@ -1521,7 +1521,8 @@ void msg_make(char_u *arg)
/// the character/string -- webb
int msg_outtrans_special(
const char_u *strstart,
int from ///< true for LHS of a mapping
bool from, ///< true for LHS of a mapping
int maxlen ///< screen columns, 0 for unlimeted
)
{
if (strstart == NULL) {
@@ -1541,6 +1542,9 @@ int msg_outtrans_special(
string = str2special((const char **)&str, from, false);
}
const int len = vim_strsize((char_u *)string);
if (maxlen > 0 && retval + len >= maxlen) {
break;
}
// Highlight special keys
msg_puts_attr(string, (len > 1
&& (*mb_ptr2len)((char_u *)string) <= 1