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.1.308 < prev    next >
Encoding:
Internet Message Format  |  2003-01-27  |  6.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.308
  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.1.308
  11. Problem:    Can't reset the Visual mode returned by visualmode().
  12. Solution:   Use an optional argument to visualmode(). (Charles Campbell)
  13. Files:        runtime/doc/eval.txt, src/eval.c, src/normal.c,
  14.         src/structs.h
  15.  
  16.  
  17. *** ../vim61.307/runtime/doc/eval.txt    Sun Jan  5 22:14:46 2003
  18. --- runtime/doc/eval.txt    Tue Jan 28 21:57:36 2003
  19. ***************
  20. *** 1,4 ****
  21. ! *eval.txt*      For Vim version 6.1.  Last change: 2003 Jan 05
  22.   
  23.   
  24.             VIM REFERENCE MANUAL    by Bram Moolenaar
  25. --- 1,4 ----
  26. ! *eval.txt*      For Vim version 6.1.  Last change: 2003 Jan 28
  27.   
  28.   
  29.             VIM REFERENCE MANUAL    by Bram Moolenaar
  30. ***************
  31. *** 865,871 ****
  32.   toupper( {expr})        String    the String {expr} switched to uppercase
  33.   type( {name})            Number    type of variable {name}
  34.   virtcol( {expr})        Number    screen column of cursor or mark
  35. ! visualmode()            String    last visual mode used
  36.   winbufnr( {nr})            Number    buffer number of window {nr}
  37.   wincol()            Number    window column of the cursor
  38.   winheight( {nr})        Number    height of window {nr}
  39. --- 869,875 ----
  40.   toupper( {expr})        String    the String {expr} switched to uppercase
  41.   type( {name})            Number    type of variable {name}
  42.   virtcol( {expr})        Number    screen column of cursor or mark
  43. ! visualmode( [expr])        String    last visual mode used
  44.   winbufnr( {nr})            Number    buffer number of window {nr}
  45.   wincol()            Number    window column of the cursor
  46.   winheight( {nr})        Number    height of window {nr}
  47. ***************
  48. *** 2391,2397 ****
  49.     virtcol("'t")    with text "    there", with 't at 'h', returns 6
  50.   <        The first column is 1.  0 is returned for an error.
  51.   
  52. ! visualmode()                        *visualmode()*
  53.           The result is a String, which describes the last Visual mode
  54.           used.  Initially it returns an empty string, but once Visual
  55.           mode has been used, it returns "v", "V", or "<CTRL-V>" (a
  56. --- 2427,2433 ----
  57.     virtcol("'t")    with text "    there", with 't at 'h', returns 6
  58.   <        The first column is 1.  0 is returned for an error.
  59.   
  60. ! visualmode([expr])                        *visualmode()*
  61.           The result is a String, which describes the last Visual mode
  62.           used.  Initially it returns an empty string, but once Visual
  63.           mode has been used, it returns "v", "V", or "<CTRL-V>" (a
  64. ***************
  65. *** 2403,2408 ****
  66. --- 2439,2449 ----
  67.           in scripts if you wish to act differently depending on the
  68.           Visual mode that was used.
  69.   
  70. +         If an expression is supplied that results in a non-zero number
  71. +         or a non-empty string, then the Visual mode will be cleared
  72. +         and the old value is returned.  Note that " " and "0" are also
  73. +         non-empty strings, thus cause the mode to be cleared.
  74.                               *winbufnr()*
  75.   winbufnr({nr})    The result is a Number, which is the number of the buffer
  76.           associated with window {nr}. When {nr} is zero, the number of
  77. *** ../vim61.307/src/eval.c    Sun Jan 19 17:16:13 2003
  78. --- src/eval.c    Tue Jan 28 22:00:17 2003
  79. ***************
  80. *** 2520,2526 ****
  81.       {"toupper",        1, 1, f_toupper},
  82.       {"type",        1, 1, f_type},
  83.       {"virtcol",        1, 1, f_virtcol},
  84. !     {"visualmode",    0, 0, f_visualmode},
  85.       {"winbufnr",    1, 1, f_winbufnr},
  86.       {"wincol",        0, 0, f_wincol},
  87.       {"winheight",    1, 1, f_winheight},
  88. --- 2520,2526 ----
  89.       {"toupper",        1, 1, f_toupper},
  90.       {"type",        1, 1, f_type},
  91.       {"virtcol",        1, 1, f_virtcol},
  92. !     {"visualmode",    0, 1, f_visualmode},
  93.       {"winbufnr",    1, 1, f_winbufnr},
  94.       {"wincol",        0, 0, f_wincol},
  95.       {"winheight",    1, 1, f_winheight},
  96. ***************
  97. *** 6587,6595 ****
  98.       char_u    str[2];
  99.   
  100.       retvar->var_type = VAR_STRING;
  101. !     str[0] = curbuf->b_visual_mode;
  102.       str[1] = NUL;
  103.       retvar->var_val.var_string = vim_strsave(str);
  104.   }
  105.   
  106.   /*
  107. --- 6587,6602 ----
  108.       char_u    str[2];
  109.   
  110.       retvar->var_type = VAR_STRING;
  111. !     str[0] = curbuf->b_visual_mode_eval;
  112.       str[1] = NUL;
  113.       retvar->var_val.var_string = vim_strsave(str);
  114. +     /* A non-zero number or non-empty string argument: reset mode. */
  115. +     if ((argvars[0].var_type == VAR_NUMBER
  116. +         && argvars[0].var_val.var_number != 0)
  117. +         || (argvars[0].var_type == VAR_STRING
  118. +         && *get_var_string(&argvars[0]) != NUL))
  119. +     curbuf->b_visual_mode_eval = NUL;
  120.   }
  121.   
  122.   /*
  123. *** ../vim61.307/src/normal.c    Sun Jan 26 22:42:25 2003
  124. --- src/normal.c    Tue Jan 28 22:03:43 2003
  125. ***************
  126. *** 1360,1365 ****
  127. --- 1360,1368 ----
  128.           curbuf->b_visual_start = VIsual;
  129.           curbuf->b_visual_end = curwin->w_cursor;
  130.           curbuf->b_visual_mode = VIsual_mode;
  131. + # ifdef FEAT_EVAL
  132. +         curbuf->b_visual_mode_eval = VIsual_mode;
  133. + # endif
  134.           curbuf->b_visual_curswant = curwin->w_curswant;
  135.   
  136.           /* In Select mode, a linewise selection is operated upon like a
  137. ***************
  138. *** 2906,2911 ****
  139. --- 2909,2917 ----
  140.   
  141.       /* Save the current VIsual area for '< and '> marks, and "gv" */
  142.       curbuf->b_visual_mode = VIsual_mode;
  143. + #ifdef FEAT_EVAL
  144. +     curbuf->b_visual_mode_eval = VIsual_mode;
  145. + #endif
  146.       curbuf->b_visual_start = VIsual;
  147.       curbuf->b_visual_end = curwin->w_cursor;
  148.       curbuf->b_visual_curswant = curwin->w_curswant;
  149. ***************
  150. *** 6697,6702 ****
  151. --- 6703,6711 ----
  152.           i = VIsual_mode;
  153.           VIsual_mode = curbuf->b_visual_mode;
  154.           curbuf->b_visual_mode = i;
  155. + # ifdef FEAT_EVAL
  156. +         curbuf->b_visual_mode_eval = i;
  157. + # endif
  158.           i = curwin->w_curswant;
  159.           curwin->w_curswant = curbuf->b_visual_curswant;
  160.           curbuf->b_visual_curswant = i;
  161. *** ../vim61.307/src/structs.h    Sun Jan  5 22:14:46 2003
  162. --- src/structs.h    Tue Jan 28 22:02:54 2003
  163. ***************
  164. *** 819,824 ****
  165. --- 821,829 ----
  166.       pos_T    b_visual_start;    /* start pos of last VIsual */
  167.       pos_T    b_visual_end;    /* end position of last VIsual */
  168.       int        b_visual_mode;    /* VIsual_mode of last VIsual */
  169. + # ifdef FEAT_EVAL
  170. +     int        b_visual_mode_eval;  /* b_visual_mode for visualmode() */
  171. + # endif
  172.       colnr_T    b_visual_curswant;   /* MAXCOL from w_curswant */
  173.   #endif
  174.   
  175. *** ../vim61.307/src/version.c    Tue Jan 28 21:51:20 2003
  176. --- src/version.c    Tue Jan 28 21:53:19 2003
  177. ***************
  178. *** 608,609 ****
  179. --- 608,611 ----
  180.   {   /* Add new patch number below this line */
  181. + /**/
  182. +     308,
  183.   /**/
  184.  
  185. -- 
  186. hundred-and-one symptoms of being an internet addict:
  187. 70. ISDN lines are added to your house on a hourly basis
  188.  
  189.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  190. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  191. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  192.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  193.