aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-30 00:56:49 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-02-16 07:49:44 -0500
commit7955c05accaac452c1350d08af62d9d75387f24f (patch)
treef04f3f3522984b2ddf638e9785631dc128afea19 /src/nvim/message.c
parent986eafce4708c8f49552d7dcd0cc5fe471caa655 (diff)
downloadrneovim-7955c05accaac452c1350d08af62d9d75387f24f.tar.gz
rneovim-7955c05accaac452c1350d08af62d9d75387f24f.tar.bz2
rneovim-7955c05accaac452c1350d08af62d9d75387f24f.zip
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
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r--src/nvim/message.c6
1 files changed, 5 insertions, 1 deletions
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