Merge pull request #4049 from watiko/vim-7.4.616

vim-patch:7.4.616
This commit is contained in:
Justin M. Keyes
2016-01-21 02:05:40 -05:00
6 changed files with 258 additions and 118 deletions

View File

@@ -1991,6 +1991,7 @@ void op_insert(oparg_T *oap, long count1)
char_u *firstline, *ins_text;
struct block_def bd;
int i;
pos_T t1;
/* edit() changes this - record it for OP_APPEND */
bd.is_MAX = (curwin->w_curswant == MAXCOL);
@@ -2053,7 +2054,16 @@ void op_insert(oparg_T *oap, long count1)
}
}
edit(NUL, FALSE, (linenr_T)count1);
t1 = oap->start;
edit(NUL, false, (linenr_T)count1);
// When a tab was inserted, and the characters in front of the tab
// have been converted to a tab as well, the column of the cursor
// might have actually been reduced, so need to adjust here. */
if (t1.lnum == curbuf->b_op_start_orig.lnum &&
lt(curbuf->b_op_start_orig, t1)) {
oap->start = curbuf->b_op_start_orig;
}
/* If user has moved off this line, we don't know what to do, so do
* nothing.
@@ -2069,21 +2079,23 @@ void op_insert(oparg_T *oap, long count1)
if (oap->start.lnum == curbuf->b_op_start_orig.lnum && !bd.is_MAX) {
if (oap->op_type == OP_INSERT
&& oap->start.col + oap->start.coladd
!= curbuf->b_op_start_orig.col + curbuf->b_op_start_orig.coladd) {
!= curbuf->b_op_start_orig.col + curbuf->b_op_start_orig.coladd) {
size_t t = getviscol2(curbuf->b_op_start_orig.col,
curbuf->b_op_start_orig.coladd);
oap->start.col = curbuf->b_op_start_orig.col;
pre_textlen -= getviscol2(oap->start.col, oap->start.coladd)
- oap->start_vcol;
oap->start_vcol = getviscol2(oap->start.col, oap->start.coladd);
pre_textlen -= t - oap->start_vcol;
oap->start_vcol = t;
} else if (oap->op_type == OP_APPEND
&& oap->end.col + oap->end.coladd
>= curbuf->b_op_start_orig.col
+ curbuf->b_op_start_orig.coladd) {
>= curbuf->b_op_start_orig.col
+ curbuf->b_op_start_orig.coladd) {
size_t t = getviscol2(curbuf->b_op_start_orig.col,
curbuf->b_op_start_orig.coladd);
oap->start.col = curbuf->b_op_start_orig.col;
/* reset pre_textlen to the value of OP_INSERT */
pre_textlen += bd.textlen;
pre_textlen -= getviscol2(oap->start.col, oap->start.coladd)
- oap->start_vcol;
oap->start_vcol = getviscol2(oap->start.col, oap->start.coladd);
pre_textlen -= t - oap->start_vcol;
oap->start_vcol = t;
oap->op_type = OP_INSERT;
}
}

View File

@@ -14,7 +14,7 @@ SCRIPTS := test_eval.out \
test24.out \
test30.out \
test32.out test34.out \
test36.out test37.out test39.out test40.out \
test36.out test37.out test40.out \
test42.out test45.out \
test47.out test48.out test49.out \
test52.out test53.out test55.out \

View File

@@ -1,106 +0,0 @@
Test Visual block mode commands
And test "U" in Visual mode, also on German sharp S.
STARTTEST
:so small.vim
:so mbyte.vim
/^abcde
:" Test shift-right of a block
jlllljj>wlljlll>
:" Test shift-left of a block
G$hhhhkk<
:" Test block-insert
GklkkkIxyz
:" Test block-replace
Gllllkkklllrq
:" Test block-change
G$khhhhhkkcmno
:$-4,$w! test.out
:" Test block-insert using cursor keys for movement
/^aaaa/
:exe ":norm! l\<C-V>jjjlllI\<Right>\<Right> \<Esc>"
:/^aa/,/^$/w >> test.out
/xaaa$/
:exe ":norm! \<C-V>jjjI<>\<Left>p\<Esc>"
:/xaaa$/,/^$/w >> test.out
:" Test for Visual block was created with the last <C-v>$
/^A23$/
:exe ":norm! l\<C-V>j$Aab\<Esc>"
:.,/^$/w >> test.out
:" Test for Visual block was created with the middle <C-v>$ (1)
/^B23$/
:exe ":norm! l\<C-V>j$hAab\<Esc>"
:.,/^$/w >> test.out
:" Test for Visual block was created with the middle <C-v>$ (2)
/^C23$/
:exe ":norm! l\<C-V>j$hhAab\<Esc>"
:.,/^$/w >> test.out
:" Test for Visual block insert when virtualedit=all and utf-8 encoding
:set ve=all
:/\t\tline
:exe ":norm! 07l\<C-V>jjIx\<Esc>"
:.,/^$/w >> test.out
:" Test for Visual block append when virtualedit=all
:exe ":norm! 012l\<C-v>jjAx\<Esc>"
:set ve=
:.,/^$/w >> test.out
:" gUe must uppercase a whole word, also when ß changes to SS
Gothe youtußeuu endYpk0wgUe
:" gUfx must uppercase until x, inclusive.
O- youßtußexu -0fogUfx
:" VU must uppercase a whole line
YpkVU
:" same, when it's the last line in the buffer
YPGi111VUddP
:" Uppercase two lines
Oblah di
doh dutVkUj
:" Uppercase part of two lines
ddppi333k0i222fyllvjfuUk
:" visual replace using Enter or NL
G3o1234567892k05l2jr
G3o987652k02l2jr
G3o1234567892k05l2jr
G3o987652k02l2jr
:"
:" Test cursor position. When ve=block and Visual block mode and $gj
:set ve=block
:exe ":norm! 2k\<C-V>$gj\<Esc>"
:let cpos=getpos("'>")
:$put ='col:'.cpos[2].' off:'.cpos[3]
:/^the/,$w >> test.out
:qa!
ENDTEST
line1
line2
line3
aaaaaa
bbbbbb
cccccc
dddddd
xaaa
bbbb
cccc
dddd
yaaa
¿¿¿
bbb
A23
4567
B23
4567
C23
4567
abcdefghijklm
abcdefghijklm
abcdefghijklm
abcdefghijklm

Binary file not shown.

View File

@@ -508,7 +508,7 @@ static int included_patches[] = {
// 619 NA
// 618 NA
617,
// 616,
616,
615,
614,
// 613,