0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 7.4.798

Problem:    Repeating a change in Visual mode does not work as expected.
            (Urtica Dioica)
Solution:   Make redo in Visual mode work better. (Christian Brabandt)
This commit is contained in:
Bram Moolenaar 2015-07-28 11:21:32 +02:00
parent 5f95f288a2
commit 31b259bf95
4 changed files with 27 additions and 9 deletions

View File

@ -9598,6 +9598,9 @@ get_op_vcol(oap, redo_VIsual_vcol, initial)
#endif #endif
getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol); getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol);
if (!redo_VIsual_busy)
{
getvvcol(curwin, &(oap->end), &start, NULL, &end); getvvcol(curwin, &(oap->end), &start, NULL, &end);
if (start < oap->start_vcol) if (start < oap->start_vcol)
@ -9610,6 +9613,8 @@ get_op_vcol(oap, redo_VIsual_vcol, initial)
else else
oap->end_vcol = end; oap->end_vcol = end;
} }
}
/* if '$' was used, get oap->end_vcol from longest line */ /* if '$' was used, get oap->end_vcol from longest line */
if (curwin->w_curswant == MAXCOL) if (curwin->w_curswant == MAXCOL)
{ {

View File

@ -74,6 +74,12 @@ Golong line: 40afoobar aTARGET at end
:let g:test ="Test 8: set linebreak with visual char mode and changing block" :let g:test ="Test 8: set linebreak with visual char mode and changing block"
:$put =g:test :$put =g:test
Go1111-1111-1111-11-1111-1111-11110f-lv3lc2222bgj. Go1111-1111-1111-11-1111-1111-11110f-lv3lc2222bgj.
:let g:test ="Test 9: using redo after block visual mode"
:$put =g:test
Go
aaa
aaa
a2k2j~e.
:%w! test.out :%w! test.out
:qa! :qa!
ENDTEST ENDTEST

View File

@ -41,3 +41,8 @@ Test 7: set linebreak with visual block mode and v_b_A
long line: foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar TARGETx at end long line: foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar TARGETx at end
Test 8: set linebreak with visual char mode and changing block Test 8: set linebreak with visual char mode and changing block
1111-2222-1111-11-1111-2222-1111 1111-2222-1111-11-1111-2222-1111
Test 9: using redo after block visual mode
AaA
AaA
A

View File

@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
798,
/**/ /**/
797, 797,
/**/ /**/