diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-10-30 02:06:07 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-11 11:53:40 -0400 |
commit | ff104e197ddeb4ff066c01400ccada3a98981373 (patch) | |
tree | fdca618f6285c896df4ac474ebf1360822e1c869 /src | |
parent | e8c2a8269e477688c9915a94f34665b04f388e76 (diff) | |
download | rneovim-ff104e197ddeb4ff066c01400ccada3a98981373.tar.gz rneovim-ff104e197ddeb4ff066c01400ccada3a98981373.tar.bz2 rneovim-ff104e197ddeb4ff066c01400ccada3a98981373.zip |
vim-patch:8.1.1204: output of :command with address completion is not nice
Problem: Output of :command with address completion is not nice.
Solution: Shorten the address completion names.
https://github.com/vim/vim/commit/a561a41a70db7a9367f883c1dbb14e69b3364d08
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_docmd.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 0a1ac7a3ed..3f4ad321e3 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5058,17 +5058,18 @@ fail: static struct { int expand; char *name; + char *shortname; } addr_type_complete[] = { - { ADDR_ARGUMENTS, "arguments" }, - { ADDR_LINES, "lines" }, - { ADDR_LOADED_BUFFERS, "loaded_buffers" }, - { ADDR_TABS, "tabs" }, - { ADDR_BUFFERS, "buffers" }, - { ADDR_WINDOWS, "windows" }, - { ADDR_QUICKFIX, "quickfix" }, - { ADDR_OTHER, "other" }, - { -1, NULL } + { ADDR_ARGUMENTS, "arguments", "arg" }, + { ADDR_LINES, "lines", "line" }, + { ADDR_LOADED_BUFFERS, "loaded_buffers", "load" }, + { ADDR_TABS, "tabs", "tab" }, + { ADDR_BUFFERS, "buffers", "buf" }, + { ADDR_WINDOWS, "windows", "win" }, + { ADDR_QUICKFIX, "quickfix", "qf" }, + { ADDR_OTHER, "other", "?" }, + { -1, NULL, NULL } }; /* @@ -5153,7 +5154,7 @@ static void uc_list(char_u *name, size_t name_len) // Put out the title first time if (!found) { MSG_PUTS_TITLE(_("\n Name Args Address " - "Complete Definition")); + "Complete Definition")); } found = true; msg_putchar('\n'); @@ -5239,13 +5240,13 @@ static void uc_list(char_u *name, size_t name_len) do { IObuff[len++] = ' '; - } while (len < 9 - over); + } while (len < 8 - over); // Address Type for (j = 0; addr_type_complete[j].expand != -1; j++) { if (addr_type_complete[j].expand != ADDR_LINES && addr_type_complete[j].expand == cmd->uc_addr_type) { - STRCPY(IObuff + len, addr_type_complete[j].name); + STRCPY(IObuff + len, addr_type_complete[j].shortname); len += (int)STRLEN(IObuff + len); break; } @@ -5264,13 +5265,13 @@ static void uc_list(char_u *name, size_t name_len) do { IObuff[len++] = ' '; - } while (len < 24 - over); + } while (len < 25 - over); IObuff[len] = '\0'; msg_outtrans(IObuff); msg_outtrans_special(cmd->uc_rep, false, - name_len == 0 ? Columns - 46 : 0); + name_len == 0 ? Columns - 47 : 0); if (p_verbose > 0) { last_set_msg(cmd->uc_script_ctx); } |