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 / 6.2.485 < prev    next >
Encoding:
Internet Message Format  |  2004-04-19  |  4.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.485
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.485
  11. Problem:    A BufWriteCmd autocommand cannot know if "!" was used or not.
  12.         (Hari Krishna Dara)
  13. Solution:   Add the v:cmdbang variable.
  14. Files:        runtime/doc/eval.txt, src/eval.c, src/proto/eval.pro,
  15.         src/fileio.c, src/vim.h
  16.  
  17.  
  18. *** ../vim-6.2.484/runtime/doc/eval.txt    Sun Apr  4 12:34:29 2004
  19. --- runtime/doc/eval.txt    Tue Apr 20 12:41:08 2004
  20. ***************
  21. *** 1,4 ****
  22. ! *eval.txt*      For Vim version 6.2.  Last change: 2004 Mar 31
  23.   
  24.   
  25.             VIM REFERENCE MANUAL    by Bram Moolenaar
  26. --- 1,4 ----
  27. ! *eval.txt*      For Vim version 6.2.  Last change: 2004 Apr 20
  28.   
  29.   
  30.             VIM REFERENCE MANUAL    by Bram Moolenaar
  31. ***************
  32. *** 578,583 ****
  33. --- 579,590 ----
  34.              the argument for the ":hardcopy" command.  This can be used
  35.              in 'printexpr'.
  36.   
  37. +                     *v:cmdbang* *cmdbang-variable*
  38. + v:cmdbang    Set like v:cmdarg for a file read/write command.  When a "!"
  39. +         was used the value is 1, otherwise it is 0.  Note that this
  40. +         can only be used in autocommands.  For user commands |<bang>|
  41. +         can be used.
  42.                       *v:count* *count-variable*
  43.   v:count        The count given for the last Normal mode command.  Can be used
  44.           to get the count before a mapping.  Read-only.  Example: >
  45. *** ../vim-6.2.484/src/eval.c    Wed Apr 14 21:41:32 2004
  46. --- src/eval.c    Tue Apr 20 10:37:31 2004
  47. ***************
  48. *** 230,235 ****
  49. --- 230,236 ----
  50.       {"exception", sizeof("exception") - 1, NULL, VAR_STRING, VV_RO},
  51.       {"throwpoint", sizeof("throwpoint") - 1, NULL, VAR_STRING, VV_RO},
  52.       {"register", sizeof("register") - 1, NULL, VAR_STRING, VV_RO},
  53. +     {"cmdbang", sizeof("cmdbang") - 1, NULL, VAR_NUMBER, VV_RO},
  54.   };
  55.   
  56.   static int eval0 __ARGS((char_u *arg,  VAR retvar, char_u **nextcmd, int evaluate));
  57. ***************
  58. *** 7846,7851 ****
  59. --- 7847,7862 ----
  60.   }
  61.   
  62.   /*
  63. +  * Get number v: variable value;
  64. +  */
  65. +     long
  66. + get_vim_var_nr(idx)
  67. +     int        idx;
  68. + {
  69. +     return (long)vimvars[idx].val;
  70. + }
  71. + /*
  72.    * Set v:count, v:count1 and v:prevcount.
  73.    */
  74.       void
  75. *** ../vim-6.2.484/src/proto/eval.pro    Sun Oct 12 20:20:38 2003
  76. --- src/proto/eval.pro    Tue Apr 20 10:45:33 2004
  77. ***************
  78. *** 28,33 ****
  79. --- 28,34 ----
  80.   char_u *get_function_name __ARGS((expand_T *xp, int idx));
  81.   char_u *get_expr_name __ARGS((expand_T *xp, int idx));
  82.   void set_vim_var_nr __ARGS((int idx, long val));
  83. + long get_vim_var_nr __ARGS((int idx));
  84.   void set_vcount __ARGS((long count, long count1));
  85.   void set_vim_var_string __ARGS((int idx, char_u *val, int len));
  86.   void set_reg_var __ARGS((int c));
  87. *** ../vim-6.2.484/src/fileio.c    Mon Apr 19 20:26:42 2004
  88. --- src/fileio.c    Tue Apr 20 10:40:44 2004
  89. ***************
  90. *** 7412,7417 ****
  91. --- 7425,7431 ----
  92.       scid_T    save_current_SID;
  93.       void    *save_funccalp;
  94.       char_u    *save_cmdarg;
  95. +     long    save_cmdbang;
  96.   #endif
  97.       static int    filechangeshell_busy = FALSE;
  98.   
  99. ***************
  100. *** 7624,7631 ****
  101. --- 7638,7649 ----
  102.       {
  103.   #ifdef FEAT_EVAL
  104.       /* set v:cmdarg (only when there is a matching pattern) */
  105. +     save_cmdbang = get_vim_var_nr(VV_CMDBANG);
  106.       if (eap != NULL)
  107. +     {
  108.           save_cmdarg = set_cmdarg(eap, NULL);
  109. +         set_vim_var_nr(VV_CMDBANG, (long)eap->forceit);
  110. +     }
  111.       else
  112.           save_cmdarg = NULL;    /* avoid gcc warning */
  113.   #endif
  114. ***************
  115. *** 7640,7646 ****
  116. --- 7658,7667 ----
  117.                        DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
  118.   #ifdef FEAT_EVAL
  119.       if (eap != NULL)
  120. +     {
  121.           (void)set_cmdarg(NULL, save_cmdarg);
  122. +         set_vim_var_nr(VV_CMDBANG, save_cmdbang);
  123. +     }
  124.   #endif
  125.       }
  126.   
  127. *** ../vim-6.2.484/src/vim.h    Fri Apr  2 14:07:44 2004
  128. --- src/vim.h    Tue Apr 20 10:28:42 2004
  129. ***************
  130. *** 1469,1475 ****
  131.   #define VV_EXCEPTION    29
  132.   #define VV_THROWPOINT    30
  133.   #define VV_REG        31
  134. ! #define VV_LEN        32    /* number of v: vars */
  135.   
  136.   #ifdef FEAT_CLIPBOARD
  137.   
  138. --- 1469,1476 ----
  139.   #define VV_EXCEPTION    29
  140.   #define VV_THROWPOINT    30
  141.   #define VV_REG        31
  142. ! #define VV_CMDBANG    32
  143. ! #define VV_LEN        33    /* number of v: vars */
  144.   
  145.   #ifdef FEAT_CLIPBOARD
  146.   
  147. *** ../vim-6.2.484/src/version.c    Mon Apr 19 23:00:46 2004
  148. --- src/version.c    Tue Apr 20 12:49:17 2004
  149. ***************
  150. *** 639,640 ****
  151. --- 639,642 ----
  152.   {   /* Add new patch number below this line */
  153. + /**/
  154. +     485,
  155.   /**/
  156.  
  157. -- 
  158. Mynd you, m00se bites Kan be pretty nasti ...
  159.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  160.  
  161.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  162. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  163. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  164.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  165.