From 7955c05accaac452c1350d08af62d9d75387f24f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 30 Oct 2019 00:56:49 -0400 Subject: 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. https://github.com/vim/vim/commit/725310d89e1ba268bf410472b7de054c6c260161 --- src/nvim/message.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim/message.c') diff --git a/src/nvim/message.c b/src/nvim/message.c index 94729dfd2a..a12e665099 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -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 -- cgit