Patch 8.1.1204
Problem:    Output of :command with address completion is not nice.
Solution:   Shorten the address completion names.
Files:      src/ex_docmd.c, runtime/doc/map.txt


*** ../vim-8.1.1203/src/ex_docmd.c      2019-04-24 23:08:20.078079973 +0200
--- src/ex_docmd.c      2019-04-25 21:23:03.102569641 +0200
***************
*** 5915,5931 ****
  {
      int           expand;
      char    *name;
  } 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}
  };
  #endif
  
--- 5915,5932 ----
  {
      int           expand;
      char    *name;
+     char    *shortname;
  } addr_type_complete[] =
  {
!     {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,6026 ****
  
            /* Put out the title first time */
            if (!found)
!               msg_puts_title(_("\n    Name              Args Address Complete 
  Definition"));
            found = TRUE;
            msg_putchar('\n');
            if (got_int)
--- 6021,6027 ----
  
            /* Put out the title first time */
            if (!found)
!               msg_puts_title(_("\n    Name              Args Address Complete 
   Definition"));
            found = TRUE;
            msg_putchar('\n');
            if (got_int)
***************
*** 6101,6114 ****
  
            do {
                IObuff[len++] = ' ';
!           } while (len < 9 - 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);
                    len += (int)STRLEN(IObuff + len);
                    break;
                }
--- 6102,6115 ----
  
            do {
                IObuff[len++] = ' ';
!           } 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].shortname);
                    len += (int)STRLEN(IObuff + len);
                    break;
                }
***************
*** 6128,6140 ****
  
            do {
                IObuff[len++] = ' ';
!           } while (len < 24 - over);
  
            IObuff[len] = '\0';
            msg_outtrans(IObuff);
  
            msg_outtrans_special(cmd->uc_rep, FALSE,
!                                            name_len == 0 ? Columns - 46 : 0);
  #ifdef FEAT_EVAL
            if (p_verbose > 0)
                last_set_msg(cmd->uc_script_ctx);
--- 6129,6141 ----
  
            do {
                IObuff[len++] = ' ';
!           } while (len < 25 - over);
  
            IObuff[len] = '\0';
            msg_outtrans(IObuff);
  
            msg_outtrans_special(cmd->uc_rep, FALSE,
!                                            name_len == 0 ? Columns - 47 : 0);
  #ifdef FEAT_EVAL
            if (p_verbose > 0)
                last_set_msg(cmd->uc_script_ctx);
*** ../vim-8.1.1203/runtime/doc/map.txt 2018-12-08 16:03:18.656085902 +0100
--- runtime/doc/map.txt 2019-04-25 21:24:01.951735065 +0200
***************
*** 371,378 ****
  
                                                        *omap-info*
  Operator-pending mappings can be used to define a movement command that can be
! used with any operator.  Simple example: ":omap { w" makes "y{" work like "yw"
! and "d{" like "dw".
  
  To ignore the starting cursor position and select different text, you can have
  the omap start Visual mode to select the text to be operated upon.  Example
--- 371,379 ----
  
                                                        *omap-info*
  Operator-pending mappings can be used to define a movement command that can be
! used with any operator.  Simple example: >
!       :omap { w
! makes "y{" work like "yw" and "d{" like "dw".
  
  To ignore the starting cursor position and select different text, you can have
  the omap start Visual mode to select the text to be operated upon.  Example
***************
*** 383,391 ****
  before it.  That usually is the function name.
  
  To enter a mapping for Normal and Visual mode, but not Operator-pending mode,
! first define it for all three modes, then unmap it for Operator-pending mode:
        :map    xx something-difficult
        :ounmap xx
  Likewise for a mapping for Visual and Operator-pending mode or Normal and
  Operator-pending mode.
  
--- 384,394 ----
  before it.  That usually is the function name.
  
  To enter a mapping for Normal and Visual mode, but not Operator-pending mode,
! first define it for all three modes, then unmap it for
! Operator-pending mode: >
        :map    xx something-difficult
        :ounmap xx
+ 
  Likewise for a mapping for Visual and Operator-pending mode or Normal and
  Operator-pending mode.
  
***************
*** 1190,1198 ****
  
  :com[mand]                                            *:com* *:command*
                        List all user-defined commands.  When listing commands,
!                       the characters in the first two columns are
                            !   Command has the -bang attribute
                            "   Command has the -register attribute
                            b   Command is local to current buffer
                        (see below for details on attributes)
                        The list can be filtered on command name with
--- 1193,1202 ----
  
  :com[mand]                                            *:com* *:command*
                        List all user-defined commands.  When listing commands,
!                       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
***************
*** 1251,1257 ****
  command can take arguments, using the -nargs attribute.  Valid cases are:
  
        -nargs=0    No arguments are allowed (the default)
!       -nargs=1    Exactly one argument is required, it includes spaces 
        -nargs=*    Any number of arguments are allowed (0, 1, or many),
                    separated by white space
        -nargs=?    0 or 1 arguments are allowed
--- 1255,1261 ----
  command can take arguments, using the -nargs attribute.  Valid cases are:
  
        -nargs=0    No arguments are allowed (the default)
!       -nargs=1    Exactly one argument is required, it includes spaces
        -nargs=*    Any number of arguments are allowed (0, 1, or many),
                    separated by white space
        -nargs=?    0 or 1 arguments are allowed
***************
*** 1276,1282 ****
  
  
  Completion behavior ~
!                               *:command-completion* *E179* *E180* *E181* 
                                *:command-complete*
  By default, the arguments of user defined commands do not undergo completion.
  However, by specifying one or the other of the following attributes, argument
--- 1280,1286 ----
  
  
  Completion behavior ~
!                               *:command-completion* *E179* *E180* *E181*
                                *:command-complete*
  By default, the arguments of user defined commands do not undergo completion.
  However, by specifying one or the other of the following attributes, argument
***************
*** 1397,1410 ****
  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 
  
  
  Special cases ~
--- 1401,1415 ----
  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 (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 ~
*** ../vim-8.1.1203/src/version.c       2019-04-25 20:28:53.327979592 +0200
--- src/version.c       2019-04-25 21:11:47.901549268 +0200
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1204,
  /**/

-- 
GUARD #1:  Where'd you get the coconut?
ARTHUR:    We found them.
GUARD #1:  Found them?  In Mercea?  The coconut's tropical!
ARTHUR:    What do you mean?
GUARD #1:  Well, this is a temperate zone.
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui