]> granicus.if.org Git - vim/commitdiff
patch 8.1.1204: output of :command with address completion is not nice v8.1.1204
authorBram Moolenaar <Bram@vim.org>
Thu, 25 Apr 2019 19:27:58 +0000 (21:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 25 Apr 2019 19:27:58 +0000 (21:27 +0200)
Problem:    Output of :command with address completion is not nice.
Solution:   Shorten the address completion names.

runtime/doc/map.txt
src/ex_docmd.c
src/version.c

index 2832bed4461f8785e7f7427869b46174e494adc3..4121fbd1c6ec44eaa399447dfe54d0c4d5dccd58 100644 (file)
@@ -1,4 +1,4 @@
-*map.txt*       For Vim version 8.1.  Last change: 2018 Dec 18
+*map.txt*       For Vim version 8.1.  Last change: 2019 Apr 25
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1193,9 +1193,10 @@ scripts.
 
 :com[mand]                                             *:com* *:command*
                        List all user-defined commands.  When listing commands,
-                       the characters in the first two columns are
+                       the characters in the first columns are:
                            !   Command has the -bang attribute
                            "   Command has the -register attribute
+                           |   Command has the -bar attribute
                            b   Command is local to current buffer
                        (see below for details on attributes)
                        The list can be filtered on command name with
@@ -1400,14 +1401,15 @@ It is possible that the special characters in the range like ., $ or % which
 by default correspond to the current line, last line and the whole buffer,
 relate to arguments, (loaded) buffers, windows or tab pages.
 
-Possible values are:
-       -addr=lines             Range of lines (this is the default)
-       -addr=arguments         Range for arguments
-       -addr=buffers           Range for buffers (also not loaded buffers)
-       -addr=loaded_buffers    Range for loaded buffers
-       -addr=windows           Range for windows
-       -addr=tabs              Range for tab pages
-       -addr=other             other kind of range
+Possible values are (second column is the short name used in listing):
+    -addr=lines                        Range of lines (this is the default)
+    -addr=arguments      arg   Range for arguments
+    -addr=buffers        buf   Range for buffers (also not loaded buffers)
+    -addr=loaded_buffers  load Range for loaded buffers
+    -addr=windows        win   Range for windows
+    -addr=tabs           tab   Range for tab pages
+    -addr=quickfix       qf    Range for quickfix entries
+    -addr=other                  ?     other kind of range
 
 
 Special cases ~
index af68a8ea701bffe8c812694fcff00e9733116298..6b2fe4628eb1b7fe44e05392b6ece79d6aa767b9 100644 (file)
@@ -5915,17 +5915,18 @@ 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}
 };
 #endif
 
@@ -6020,7 +6021,7 @@ 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"));
+               msg_puts_title(_("\n    Name              Args Address Complete    Definition"));
            found = TRUE;
            msg_putchar('\n');
            if (got_int)
@@ -6101,14 +6102,14 @@ 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;
                }
@@ -6128,13 +6129,13 @@ 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);
 #ifdef FEAT_EVAL
            if (p_verbose > 0)
                last_set_msg(cmd->uc_script_ctx);
index 2b90f018adad754a17e7fbe6f8598480e8a758cc..330bdf11b29894def07464f4e6c681002f856211 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1204,
 /**/
     1203,
 /**/