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.1 / 7.1.243 < prev    next >
Encoding:
Internet Message Format  |  2008-02-05  |  4.4 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.1.243
  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 7.1.243 (after 7.1.240)
  11. Problem:    "U" doesn't work on all text in Visual mode. (Adri Verhoef)
  12. Solution:   Loop over all the lines to be changed.  Add tests for this.
  13. Files:        src/ops.c, src/testdir/test39.in, src/testdir/test39.ok
  14.  
  15.  
  16. *** ../vim-7.1.242/src/ops.c    Tue Jan 22 16:01:25 2008
  17. --- src/ops.c    Mon Feb  4 22:23:22 2008
  18. ***************
  19. *** 2197,2203 ****
  20.   #ifdef FEAT_VISUAL
  21.       struct block_def    bd;
  22.   #endif
  23. !     int            did_change;
  24.   
  25.       if (u_save((linenr_T)(oap->start.lnum - 1),
  26.                          (linenr_T)(oap->end.lnum + 1)) == FAIL)
  27. --- 2197,2203 ----
  28.   #ifdef FEAT_VISUAL
  29.       struct block_def    bd;
  30.   #endif
  31. !     int            did_change = FALSE;
  32.   
  33.       if (u_save((linenr_T)(oap->start.lnum - 1),
  34.                          (linenr_T)(oap->end.lnum + 1)) == FAIL)
  35. ***************
  36. *** 2242,2248 ****
  37.       else if (!oap->inclusive)
  38.           dec(&(oap->end));
  39.   
  40. !     did_change = swapchars(oap->op_type, &pos, oap->end.col - pos.col + 1);
  41.       if (did_change)
  42.       {
  43.           changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
  44. --- 2242,2259 ----
  45.       else if (!oap->inclusive)
  46.           dec(&(oap->end));
  47.   
  48. !     if (pos.lnum == oap->end.lnum)
  49. !         did_change = swapchars(oap->op_type, &pos,
  50. !                           oap->end.col - pos.col + 1);
  51. !     else
  52. !         for (;;)
  53. !         {
  54. !         did_change |= swapchars(oap->op_type, &pos,
  55. !                 pos.lnum == oap->end.lnum ? oap->end.col + 1:
  56. !                        (int)STRLEN(ml_get_pos(&pos)));
  57. !         if (ltoreq(oap->end, pos) || inc(&pos) == -1)
  58. !             break;
  59. !         }
  60.       if (did_change)
  61.       {
  62.           changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
  63. ***************
  64. *** 2314,2330 ****
  65.       for (todo = length; todo > 0; --todo)
  66.       {
  67.   # ifdef FEAT_MBYTE
  68. -     int pos_col = pos->col;
  69.       if (has_mbyte)
  70.           /* we're counting bytes, not characters */
  71.           todo -= (*mb_ptr2len)(ml_get_pos(pos)) - 1;
  72.   # endif
  73.       did_change |= swapchar(op_type, pos);
  74. - # ifdef FEAT_MBYTE
  75. -     /* Changing German sharp s to SS increases the column. */
  76. -     todo += pos->col - pos_col;
  77. - # endif
  78.       if (inc(pos) == -1)    /* at end of file */
  79.           break;
  80.       }
  81. --- 2325,2335 ----
  82. *** ../vim-7.1.242/src/testdir/test39.in    Sun Jun 13 18:21:09 2004
  83. --- src/testdir/test39.in    Wed Feb  6 13:57:37 2008
  84. ***************
  85. *** 1,8 ****
  86. --- 1,10 ----
  87.   
  88.   Test Visual block mode commands
  89. + And test "U" in Visual mode, also on German sharp S.
  90.   
  91.   STARTTEST
  92.   :so small.vim
  93. + :so mbyte.vim
  94.   /^abcde
  95.   :" Test shift-right of a block
  96.   jlllljj>wlljlll>
  97. ***************
  98. *** 14,20 ****
  99.   Gllllkkklllrq
  100.   :" Test block-change
  101.   G$khhhhhkkcmno
  102. ! :$-4,$wq! test.out
  103.   ENDTEST
  104.   
  105.   abcdefghijklm
  106. --- 16,37 ----
  107.   Gllllkkklllrq
  108.   :" Test block-change
  109.   G$khhhhhkkcmno
  110. ! :$-4,$w! test.out
  111. ! :" gUe must uppercase a whole word, also when ▀ changes to SS
  112. ! Gothe youtu▀euu endYpk0wgUe
  113. ! :" gUfx must uppercase until x, inclusive.
  114. ! O- you▀tu▀exu -fogUfx
  115. ! :" VU must uppercase a whole line
  116. ! YpkVU
  117. ! :" same, when it's the last line in the buffer
  118. ! YPGi111VUddP
  119. ! :" Uppercase two lines
  120. ! Oblah di
  121. ! doh dutVkUj
  122. ! :" Uppercase part of two lines
  123. ! ddppi333k0i222fyllvjfuUk
  124. ! :/^the/,$w >> test.out
  125. ! :qa!
  126.   ENDTEST
  127.   
  128.   abcdefghijklm
  129. *** ../vim-7.1.242/src/testdir/test39.ok    Sun Jun 13 18:59:28 2004
  130. --- src/testdir/test39.ok    Tue Feb  5 22:25:38 2008
  131. ***************
  132. *** 3,5 ****
  133. --- 3,13 ----
  134.   axyzqqqqef mno        ghijklm
  135.   axyzqqqqefgmnoklm
  136.   abcdqqqqijklm
  137. + the YOUTUSSEUU end
  138. + - yOUSSTUSSEXu -
  139. + THE YOUTUSSEUU END
  140. + 111THE YOUTUSSEUU END
  141. + BLAH DI
  142. + DOH DUT
  143. + 222the yoUTUSSEUU END
  144. + 333THE YOUTU▀euu end
  145. *** ../vim-7.1.242/src/version.c    Sat Jan 26 21:15:00 2008
  146. --- src/version.c    Wed Feb  6 14:41:00 2008
  147. ***************
  148. *** 668,669 ****
  149. --- 668,671 ----
  150.   {   /* Add new patch number below this line */
  151. + /**/
  152. +     243,
  153.   /**/
  154.  
  155. -- 
  156. It's totally unfair to suggest - as many have - that engineers are socially
  157. inept.  Engineers simply have different objectives when it comes to social
  158. interaction.
  159.                 (Scott Adams - The Dilbert principle)
  160.  
  161.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  162. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  163. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  164.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  165.