home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.615 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  2.8 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.615
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.615
  11. Problem:    Completion for a user command does not recognize backslash before
  12.         a space.
  13. Solution:   Recognize escaped characters. (Yasuhiro Matsumoto)
  14. Files:        src/ex_docmd.c
  15.  
  16.  
  17. *** ../vim-7.3.614/src/ex_docmd.c    2012-07-10 19:25:06.000000000 +0200
  18. --- src/ex_docmd.c    2012-07-25 17:10:16.000000000 +0200
  19. ***************
  20. *** 3390,3401 ****
  21.       return NULL;
  22.   
  23.       /* Find start of last argument (argument just before cursor): */
  24. !     p = buff + STRLEN(buff);
  25. !     while (p != arg && *p != ' ' && *p != TAB)
  26. !     p--;
  27. !     if (*p == ' ' || *p == TAB)
  28. !     p++;
  29.       xp->xp_pattern = p;
  30.   
  31.       if (ea.argt & XFILE)
  32.       {
  33. --- 3390,3412 ----
  34.       return NULL;
  35.   
  36.       /* Find start of last argument (argument just before cursor): */
  37. !     p = buff;
  38.       xp->xp_pattern = p;
  39. +     len = STRLEN(buff);
  40. +     while (*p && p < buff + len)
  41. +     {
  42. +     if (*p == ' ' || *p == TAB)
  43. +     {
  44. +         /* argument starts after a space */
  45. +         xp->xp_pattern = ++p;
  46. +     }
  47. +     else
  48. +     {
  49. +         if (*p == '\\' && *(p + 1) != NUL)
  50. +         ++p; /* skip over escaped character */
  51. +         mb_ptr_adv(p);
  52. +     }
  53. +     }
  54.   
  55.       if (ea.argt & XFILE)
  56.       {
  57. ***************
  58. *** 3821,3828 ****
  59.               if (compl == EXPAND_MAPPINGS)
  60.               return set_context_in_map_cmd(xp, (char_u *)"map",
  61.                        arg, forceit, FALSE, FALSE, CMD_map);
  62. !             while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL)
  63. !             arg = xp->xp_pattern + 1;
  64.               xp->xp_pattern = arg;
  65.           }
  66.           xp->xp_context = compl;
  67. --- 3832,3853 ----
  68.               if (compl == EXPAND_MAPPINGS)
  69.               return set_context_in_map_cmd(xp, (char_u *)"map",
  70.                        arg, forceit, FALSE, FALSE, CMD_map);
  71. !             /* Find start of last argument. */
  72. !             p = arg;
  73. !             while (*p)
  74. !             {
  75. !             if (*p == ' ')
  76. !             {
  77. !                 /* argument starts after a space */
  78. !                 arg = p + 1;
  79. !             }
  80. !             else
  81. !             {
  82. !                 if (*p == '\\' && *(p + 1) != NUL)
  83. !                 ++p; /* skip over escaped character */
  84. !                 mb_ptr_adv(p);
  85. !             }
  86. !             }
  87.               xp->xp_pattern = arg;
  88.           }
  89.           xp->xp_context = compl;
  90. *** ../vim-7.3.614/src/version.c    2012-07-25 16:46:59.000000000 +0200
  91. --- src/version.c    2012-07-25 17:17:05.000000000 +0200
  92. ***************
  93. *** 716,717 ****
  94. --- 716,719 ----
  95.   {   /* Add new patch number below this line */
  96. + /**/
  97. +     615,
  98.   /**/
  99.  
  100. -- 
  101. hundred-and-one symptoms of being an internet addict:
  102. 172. You join listservers just for the extra e-mail.
  103.  
  104.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  105. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  106. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  107.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  108.