summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-04-20 22:01:41 +0200
committerBram Moolenaar <Bram@vim.org>2018-04-20 22:01:41 +0200
commit5d69da462f584a3aefb3427b127334bf9af3a4b0 (patch)
tree05427fccf4d57a03629b4f45b8cae2d5b10c9cea /src/ex_cmds2.c
parent02e802b2da9e25b5824185976b163691b5bbd558 (diff)
patch 8.0.1738: ":args" output is hard to readv8.0.1738
Problem: ":args" output is hard to read. Solution: Make columns with the names if the output is more than one line.
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 3946627416..c8e9785cc4 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -2751,17 +2751,18 @@ ex_args(exarg_T *eap)
*/
if (ARGCOUNT > 0)
{
- /* Overwrite the command, for a short list there is no scrolling
- * required and no wait_return(). */
- gotocmdline(TRUE);
- for (i = 0; i < ARGCOUNT; ++i)
+ char **items = (char **)alloc(sizeof(char *) * ARGCOUNT);
+
+ if (items != NULL)
{
- if (i == curwin->w_arg_idx)
- msg_putchar('[');
- msg_outtrans(alist_name(&ARGLIST[i]));
- if (i == curwin->w_arg_idx)
- msg_putchar(']');
- msg_putchar(' ');
+ /* Overwrite the command, for a short list there is no
+ * scrolling required and no wait_return(). */
+ gotocmdline(TRUE);
+
+ for (i = 0; i < ARGCOUNT; ++i)
+ items[i] = (char *)alist_name(&ARGLIST[i]);
+ list_in_columns(items, ARGCOUNT, curwin->w_arg_idx);
+ vim_free(items);
}
}
}