Patch 7.4.1833
Problem:    Cannot use an Ex command for 'keywordprg'.
Solution:   Accept an Ex command. (Nelo-Thara Wallus)
Files:      src/normal.c, runtime/doc/options.txt


*** ../vim-7.4.1832/src/normal.c        2016-04-16 09:13:31.538407268 +0200
--- src/normal.c        2016-05-24 10:24:39.207560023 +0200
***************
*** 5485,5494 ****
  {
      char_u    *ptr = NULL;
      char_u    *buf;
      char_u    *newbuf;
      char_u    *p;
      char_u    *kp;            /* value of 'keywordprg' */
!     int               kp_help;        /* 'keywordprg' is ":help" */
      int               n = 0;          /* init for GCC */
      int               cmdchar;
      int               g_cmd;          /* "g" command */
--- 5485,5496 ----
  {
      char_u    *ptr = NULL;
      char_u    *buf;
+     unsigned  buflen;
      char_u    *newbuf;
      char_u    *p;
      char_u    *kp;            /* value of 'keywordprg' */
!     int               kp_help;        /* 'keywordprg' is ":he" */
!     int               kp_ex;          /* 'keywordprg' starts with ":" */
      int               n = 0;          /* init for GCC */
      int               cmdchar;
      int               g_cmd;          /* "g" command */
***************
*** 5536,5542 ****
      kp = (*curbuf->b_p_kp == NUL ? p_kp : curbuf->b_p_kp);
      kp_help = (*kp == NUL || STRCMP(kp, ":he") == 0
                                                 || STRCMP(kp, ":help") == 0);
!     buf = alloc((unsigned)(n * 2 + 30 + STRLEN(kp)));
      if (buf == NULL)
        return;
      buf[0] = NUL;
--- 5538,5546 ----
      kp = (*curbuf->b_p_kp == NUL ? p_kp : curbuf->b_p_kp);
      kp_help = (*kp == NUL || STRCMP(kp, ":he") == 0
                                                 || STRCMP(kp, ":help") == 0);
!     kp_ex = (*kp == ':');
!     buflen = (unsigned)(n * 2 + 30 + STRLEN(kp));
!     buf = alloc(buflen);
      if (buf == NULL)
        return;
      buf[0] = NUL;
***************
*** 5562,5567 ****
--- 5566,5580 ----
        case 'K':
            if (kp_help)
                STRCPY(buf, "he! ");
+           else if (kp_ex)
+           {
+               if (cap->count0 != 0)
+                   vim_snprintf((char *)buf, buflen, "%s %ld",
+                                                            kp, cap->count0);
+               else
+                   STRCPY(buf, kp);
+               STRCAT(buf, " ");
+           }
            else
            {
                /* An external command will probably use an argument starting
*** ../vim-7.4.1832/runtime/doc/options.txt     2016-05-11 21:04:59.804470690 
+0200
--- runtime/doc/options.txt     2016-05-24 10:16:12.283566996 +0200
***************
*** 4591,4606 ****
  
                                        *'keywordprg'* *'kp'*
  'keywordprg' 'kp'     string  (default "man" or "man -s",  DOS: ":help",
!                                               OS/2: "view /", VMS: "help")
                        global or local to buffer |global-local|
                        {not in Vi}
        Program to use for the |K| command.  Environment variables are
        expanded |:set_env|.  ":help" may be used to access the Vim internal
        help.  (Note that previously setting the global option to the empty
        value did this, which is now deprecated.)
!       When "man" is used, Vim will automatically translate a count for the
!       "K" command to a section number.  Also for "man -s", in which case the
!       "-s" is removed when there is no count.
        See |option-backslash| about including spaces and backslashes.
        Example: >
                :set keywordprg=man\ -s
--- 4587,4604 ----
  
                                        *'keywordprg'* *'kp'*
  'keywordprg' 'kp'     string  (default "man" or "man -s",  DOS: ":help",
!                                                                 VMS: "help")
                        global or local to buffer |global-local|
                        {not in Vi}
        Program to use for the |K| command.  Environment variables are
        expanded |:set_env|.  ":help" may be used to access the Vim internal
        help.  (Note that previously setting the global option to the empty
        value did this, which is now deprecated.)
!       When the first character is ":", the command is invoked as a Vim
!       Ex command prefixed with [count].
!       When "man", "man -s" or an Ex command is used, Vim will automatically
!       translate a count for the "K" command and pass it as the first
!       argument.  For "man -s" the "-s" is removed when there is no count.
        See |option-backslash| about including spaces and backslashes.
        Example: >
                :set keywordprg=man\ -s
*** ../vim-7.4.1832/src/version.c       2016-05-17 17:45:24.307426095 +0200
--- src/version.c       2016-05-24 10:26:32.099558470 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1833,
  /**/

-- 
Engineers understand that their appearance only bothers other people and
therefore it is not worth optimizing.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui