diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-08 11:35:53 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-07-24 06:09:28 +0200 |
commit | e134cc9d4a13034401a1323e0515ceb19d43dfea (patch) | |
tree | 1eb5b729261951fa1747f91a1db3d9dfe03978fb /src/nvim/ex_cmds2.c | |
parent | 8fc93241d680f7c73e3013d679adb70c09cb3d57 (diff) | |
download | rneovim-e134cc9d4a13034401a1323e0515ceb19d43dfea.tar.gz rneovim-e134cc9d4a13034401a1323e0515ceb19d43dfea.tar.bz2 rneovim-e134cc9d4a13034401a1323e0515ceb19d43dfea.zip |
vim-patch:8.0.1738: ":args" output is hard to read
Problem: ":args" output is hard to read.
Solution: Make columns with the names if the output is more than one line.
https://github.com/vim/vim/commit/5d69da462f584a3aefb3427b127334bf9af3a4b0
vim-patch:8.0.1740: warning for signed-unsigned incompatibility
Problem: Warning for signed-unsigned incompatibility.
Solution: Change type from "char *" to "char_u *". (John Marriott)
https://github.com/vim/vim/commit/405dadb63ea2b7aa4c8c659807506a35a8a9504c
Removes ported legacy test that was re-added later.
Ref: https://github.com/neovim/neovim/pull/10147#issuecomment-512609513
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index c092036ce9..9e915dfc8b 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -43,6 +43,7 @@ #include "nvim/screen.h" #include "nvim/strings.h" #include "nvim/undo.h" +#include "nvim/version.h" #include "nvim/window.h" #include "nvim/profile.h" #include "nvim/os/os.h" @@ -1791,18 +1792,17 @@ void ex_args(exarg_T *eap) } else if (eap->cmdidx == CMD_args) { // ":args": list arguments. if (ARGCOUNT > 0) { - // Overwrite the command, for a short list there is no scrolling - // required and no wait_return(). - gotocmdline(true); - for (int i = 0; i < ARGCOUNT; i++) { - if (i == curwin->w_arg_idx) { - msg_putchar('['); + char_u **items = xmalloc(sizeof(char_u *) * (size_t)ARGCOUNT); + + if (items != NULL) { + // Overwrite the command, for a short list there is no scrolling + // required and no wait_return(). + gotocmdline(true); + for (int i = 0; i < ARGCOUNT; i++) { + items[i] = alist_name(&ARGLIST[i]); } - msg_outtrans(alist_name(&ARGLIST[i])); - if (i == curwin->w_arg_idx) { - msg_putchar(']'); - } - msg_putchar(' '); + list_in_columns(items, ARGCOUNT, curwin->w_arg_idx); + xfree(items); } } } else if (eap->cmdidx == CMD_arglocal) { |