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.0.187 < prev    next >
Encoding:
Internet Message Format  |  2002-02-04  |  3.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.187
  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.0.187
  11. Problem:    "I" in Visual mode and then "u" reports too many changes. (Andrew
  12.         Stryker)
  13.         "I" in Visual linewise mode adjusts the indent for no apparent
  14.         reason.
  15. Solution:   Only save those lines for undo that are changed.
  16.         Don't change the indent after inserting in Visual linewise mode.
  17. Files:        src/ops.c
  18.  
  19.  
  20. *** ../vim60.186/src/ops.c    Mon Feb  4 12:54:37 2002
  21. --- src/ops.c    Tue Feb  5 21:31:39 2002
  22. ***************
  23. *** 509,514 ****
  24. --- 509,515 ----
  25.   #ifdef FEAT_VISUALEXTRA
  26.   /*
  27.    * Insert string "s" (b_insert ? before : after) block :AKelly
  28. +  * Caller must prepare for undo.
  29.    */
  30.       static void
  31.   block_insert(oap, s, b_insert, bdp)
  32. ***************
  33. *** 2098,2107 ****
  34.       struct block_def    bd;
  35.       int            i;
  36.   
  37. -     if (u_save((linenr_T)(oap->start.lnum - 1),
  38. -            (linenr_T)(oap->end.lnum + 1)) == FAIL)
  39. -     return;
  40.       /* edit() changes this - record it for OP_APPEND */
  41.       bd.is_MAX = (curwin->w_curswant == MAXCOL);
  42.   
  43. --- 2099,2104 ----
  44. ***************
  45. *** 2121,2126 ****
  46. --- 2118,2125 ----
  47.           int        old_ve_flags = ve_flags;
  48.   
  49.           ve_flags = VE_ALL;
  50. +         if (u_save_cursor() == FAIL)
  51. +         return;
  52.           coladvance_force(oap->op_type == OP_APPEND
  53.                          ? oap->end_vcol + 1 : getviscol());
  54.           if (oap->op_type == OP_APPEND)
  55. ***************
  56. *** 2153,2158 ****
  57. --- 2152,2159 ----
  58.           {
  59.           /* First line was too short, make it longer and adjust the
  60.            * values in "bd". */
  61. +         if (u_save_cursor() == FAIL)
  62. +             return;
  63.           for (i = 0; i < bd.endspaces; ++i)
  64.               ins_char(' ');
  65.           bd.textlen += bd.endspaces;
  66. ***************
  67. *** 2176,2182 ****
  68.       if (curwin->w_cursor.lnum != oap->start.lnum)
  69.       return;
  70.   
  71.       if (oap->block_mode)
  72.       {
  73.       struct block_def    bd2;
  74. --- 2177,2182 ----
  75. ***************
  76. *** 2212,2230 ****
  77.           if (ins_text != NULL)
  78.           {
  79.           /* block handled here */
  80. !         block_insert(oap, ins_text, (oap->op_type == OP_INSERT), &bd);
  81.   
  82.           curwin->w_cursor.col = oap->start.col;
  83.           check_cursor();
  84.           }
  85. -         vim_free(ins_text);
  86.       }
  87.       }
  88. - #if defined(FEAT_LISP) || defined(FEAT_CINDENT)
  89. -     if (oap->motion_type == MLINE)
  90. -     fix_indent();
  91. - #endif
  92.   }
  93.   #endif
  94.   
  95. --- 2212,2228 ----
  96.           if (ins_text != NULL)
  97.           {
  98.           /* block handled here */
  99. !         if (u_save(oap->start.lnum,
  100. !                      (linenr_T)(oap->end.lnum + 1)) == OK)
  101. !             block_insert(oap, ins_text, (oap->op_type == OP_INSERT),
  102. !                                      &bd);
  103.   
  104.           curwin->w_cursor.col = oap->start.col;
  105.           check_cursor();
  106. +         vim_free(ins_text);
  107.           }
  108.       }
  109.       }
  110.   }
  111.   #endif
  112.   
  113. *** ../vim60.186/src/version.c    Tue Feb  5 13:38:48 2002
  114. --- src/version.c    Tue Feb  5 21:36:27 2002
  115. ***************
  116. *** 608,609 ****
  117. --- 608,611 ----
  118.   {   /* Add new patch number below this line */
  119. + /**/
  120. +     187,
  121.   /**/
  122.  
  123. -- 
  124. hundred-and-one symptoms of being an internet addict:
  125. 234. You started college as a chemistry major, and walk out four years
  126.      later as an Internet provider.
  127.  
  128.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  129. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  130.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  131.