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.2 / 7.2.313 < prev    next >
Encoding:
Internet Message Format  |  2009-12-01  |  3.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.2.313
  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.2.313
  11. Problem:    Command line completion doesn't work after "%:h" and similar.
  12. Solution:   Expand these items before doing the completion.
  13. Files:        src/ex_getln.c, src/misc1.c, src/proto/misc1.pro
  14.  
  15.  
  16. *** ../vim-7.2.312/src/ex_getln.c    2009-09-18 17:24:54.000000000 +0200
  17. --- src/ex_getln.c    2009-12-02 16:40:06.000000000 +0100
  18. ***************
  19. *** 4422,4428 ****
  20.           flags |= EW_FILE;
  21.       else
  22.           flags = (flags | EW_DIR) & ~EW_FILE;
  23. !     ret = expand_wildcards(1, &pat, num_file, file, flags);
  24.       if (free_pat)
  25.           vim_free(pat);
  26.       return ret;
  27. --- 4422,4429 ----
  28.           flags |= EW_FILE;
  29.       else
  30.           flags = (flags | EW_DIR) & ~EW_FILE;
  31. !     /* Expand wildcards, supporting %:h and the like. */
  32. !     ret = expand_wildcards_eval(&pat, num_file, file, flags);
  33.       if (free_pat)
  34.           vim_free(pat);
  35.       return ret;
  36. *** ../vim-7.2.312/src/misc1.c    2009-11-17 16:08:12.000000000 +0100
  37. --- src/misc1.c    2009-12-02 17:06:49.000000000 +0100
  38. ***************
  39. *** 8447,8452 ****
  40. --- 8447,8492 ----
  41.   }
  42.   
  43.   /*
  44. +  * Invoke expand_wildcards() for one pattern.
  45. +  * Expand items like "%:h" before the expansion.
  46. +  * Returns OK or FAIL.
  47. +  */
  48. +     int
  49. + expand_wildcards_eval(pat, num_file, file, flags)
  50. +     char_u     **pat;        /* pointer to input pattern */
  51. +     int          *num_file;    /* resulting number of files */
  52. +     char_u    ***file;    /* array of resulting files */
  53. +     int           flags;    /* EW_DIR, etc. */
  54. + {
  55. +     int        ret = FAIL;
  56. +     char_u    *eval_pat = NULL;
  57. +     char_u    *exp_pat = *pat;
  58. +     char_u      *ignored_msg;
  59. +     int        usedlen;
  60. +     if (*exp_pat == '%' || *exp_pat == '#' || *exp_pat == '<')
  61. +     {
  62. +     ++emsg_off;
  63. +     eval_pat = eval_vars(exp_pat, exp_pat, &usedlen,
  64. +                             NULL, &ignored_msg, NULL);
  65. +     --emsg_off;
  66. +     if (eval_pat != NULL)
  67. +         exp_pat = concat_str(eval_pat, exp_pat + usedlen);
  68. +     }
  69. +     if (exp_pat != NULL)
  70. +     ret = expand_wildcards(1, &exp_pat, num_file, file, flags);
  71. +     if (eval_pat != NULL)
  72. +     {
  73. +     vim_free(exp_pat);
  74. +     vim_free(eval_pat);
  75. +     }
  76. +     return ret;
  77. + }
  78. + /*
  79.    * Expand wildcards.  Calls gen_expand_wildcards() and removes files matching
  80.    * 'wildignore'.
  81.    * Returns OK or FAIL.
  82. *** ../vim-7.2.312/src/proto/misc1.pro    2007-09-26 22:36:32.000000000 +0200
  83. --- src/proto/misc1.pro    2009-12-02 16:41:52.000000000 +0100
  84. ***************
  85. *** 85,90 ****
  86. --- 85,91 ----
  87.   int vim_fexists __ARGS((char_u *fname));
  88.   void line_breakcheck __ARGS((void));
  89.   void fast_breakcheck __ARGS((void));
  90. + int expand_wildcards_eval __ARGS((char_u **pat, int *num_file, char_u ***file, int flags));
  91.   int expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
  92.   int match_suffix __ARGS((char_u *fname));
  93.   int unix_expandpath __ARGS((garray_T *gap, char_u *path, int wildoff, int flags, int didstar));
  94. *** ../vim-7.2.312/src/version.c    2009-12-02 15:03:24.000000000 +0100
  95. --- src/version.c    2009-12-02 17:14:02.000000000 +0100
  96. ***************
  97. *** 683,684 ****
  98. --- 683,686 ----
  99.   {   /* Add new patch number below this line */
  100. + /**/
  101. +     313,
  102.   /**/
  103.  
  104. -- 
  105. hundred-and-one symptoms of being an internet addict:
  106. 8. You spend half of the plane trip with your laptop on your lap...and your
  107.    child in the overhead compartment.
  108.  
  109.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  110. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  111. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  112.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  113.