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.409 < prev    next >
Encoding:
Internet Message Format  |  2004-03-27  |  2.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.409
  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.409
  11. Problem:    The cursor ends up in the last column instead of after the line
  12.         when doing "i//<Esc>o" with 'indentexpr' set to "cindent(v:lnum)".
  13.         (Toby Allsopp)
  14. Solution:   Adjust the cursor as if in Insert mode.
  15. Files:        src/misc1.c
  16.  
  17.  
  18. *** ../vim-6.2.408/src/misc1.c    Thu Mar 18 14:39:31 2004
  19. --- src/misc1.c    Sun Mar 28 13:57:35 2004
  20. ***************
  21. *** 6170,6175 ****
  22. --- 6170,6176 ----
  23.                *  }
  24.                *  case 2:
  25.                *    stat;
  26. +              * }
  27.                */
  28.               iscase = (ind_keep_case_label && cin_iscase(l));
  29.   
  30. ***************
  31. *** 6504,6509 ****
  32. --- 6505,6511 ----
  33.   {
  34.       int        indent;
  35.       pos_T    pos;
  36. +     int        save_State;
  37.   
  38.       pos = curwin->w_cursor;
  39.       set_vim_var_nr(VV_LNUM, curwin->w_cursor.lnum);
  40. ***************
  41. *** 6511,6519 ****
  42.       indent = eval_to_number(curbuf->b_p_inde);
  43.       --sandbox;
  44.   
  45. !     /* restore the cursor position so that 'indentexpr' doesn't need to */
  46.       curwin->w_cursor = pos;
  47.       check_cursor();
  48.   
  49.       /* If there is an error, just keep the current indent. */
  50.       if (indent < 0)
  51. --- 6513,6526 ----
  52.       indent = eval_to_number(curbuf->b_p_inde);
  53.       --sandbox;
  54.   
  55. !     /* Restore the cursor position so that 'indentexpr' doesn't need to.
  56. !      * Pretend to be in Insert mode, allow cursor past end of line for "o"
  57. !      * command. */
  58. !     save_State = State;
  59. !     State = INSERT;
  60.       curwin->w_cursor = pos;
  61.       check_cursor();
  62. +     State = save_State;
  63.   
  64.       /* If there is an error, just keep the current indent. */
  65.       if (indent < 0)
  66. *** ../vim-6.2.408/src/version.c    Sat Mar 27 13:23:01 2004
  67. --- src/version.c    Sun Mar 28 13:54:50 2004
  68. ***************
  69. *** 639,640 ****
  70. --- 639,642 ----
  71.   {   /* Add new patch number below this line */
  72. + /**/
  73. +     409,
  74.   /**/
  75.  
  76. -- 
  77. hundred-and-one symptoms of being an internet addict:
  78. 168. You have your own domain name.
  79.  
  80.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  81. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  82. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  83.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  84.