4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
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
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
25 if (u_save((linenr_T)(oap->start.lnum - 1),
26 (linenr_T)(oap->end.lnum + 1)) == FAIL)
31 ! int did_change = FALSE;
33 if (u_save((linenr_T)(oap->start.lnum - 1),
34 (linenr_T)(oap->end.lnum + 1)) == FAIL)
37 else if (!oap->inclusive)
40 ! did_change = swapchars(oap->op_type, &pos, oap->end.col - pos.col + 1);
43 changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
45 else if (!oap->inclusive)
48 ! if (pos.lnum == oap->end.lnum)
49 ! did_change = swapchars(oap->op_type, &pos,
50 ! oap->end.col - pos.col + 1);
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)
62 changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
65 for (todo = length; todo > 0; --todo)
68 - int pos_col = pos->col;
71 /* we're counting bytes, not characters */
72 todo -= (*mb_ptr2len)(ml_get_pos(pos)) - 1;
74 did_change |= swapchar(op_type, pos);
76 - /* Changing German sharp s to SS increases the column. */
77 - todo += pos->col - pos_col;
79 if (inc(pos) == -1) /* at end of file */
83 *** ../vim-7.1.242/src/testdir/test39.in Sun Jun 13 18:21:09 2004
84 --- src/testdir/test39.in Wed Feb 6 13:57:37 2008
89 Test Visual block mode commands
90 + And test "U" in Visual mode, also on German sharp S.
96 :" Test shift-right of a block
97 jllll
\16jj>wll
\16jlll>
112 ! :" gUe must uppercase a whole word, also when ß changes to SS
113 ! Gothe youtußeuu end
\eYpk0wgUe
114 ! :" gUfx must uppercase until x, inclusive.
115 ! O- youßtußexu -
\e0fogUfx
116 ! :" VU must uppercase a whole line
118 ! :" same, when it's the last line in the buffer
120 ! :" Uppercase two lines
123 ! :" Uppercase part of two lines
124 ! ddppi333
\ek0i222
\efyllvjfuUk
125 ! :/^the/,$w >> test.out
130 *** ../vim-7.1.242/src/testdir/test39.ok Sun Jun 13 18:59:28 2004
131 --- src/testdir/test39.ok Tue Feb 5 22:25:38 2008
135 axyzqqqqef mno ghijklm
141 + 111THE YOUTUSSEUU END
144 + 222the yoUTUSSEUU END
145 + 333THE YOUTUßeuu end
146 *** ../vim-7.1.242/src/version.c Sat Jan 26 21:15:00 2008
147 --- src/version.c Wed Feb 6 14:41:00 2008
151 { /* Add new patch number below this line */
157 It's totally unfair to suggest - as many have - that engineers are socially
158 inept. Engineers simply have different objectives when it comes to social
160 (Scott Adams - The Dilbert principle)
162 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
163 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
164 \\\ download, build and distribute -- http://www.A-A-P.org ///
165 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///