summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-07-28 11:21:32 +0200
committerBram Moolenaar <Bram@vim.org>2015-07-28 11:21:32 +0200
commit31b259bf9571cae6408be3ef75d9485e24029be5 (patch)
treec4af83ad0c9d6cc0ea766f5d0641136ba091ef99
parent5f95f288a2d303be1571e818655fd90e399ee58e (diff)
patch 7.4.798v7.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)
-rw-r--r--src/normal.c23
-rw-r--r--src/testdir/test_listlbr.in6
-rw-r--r--src/testdir/test_listlbr.ok5
-rw-r--r--src/version.c2
4 files changed, 27 insertions, 9 deletions
diff --git a/src/normal.c b/src/normal.c
index 599b12ac1f..51aaeccb42 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -9598,18 +9598,23 @@ get_op_vcol(oap, redo_VIsual_vcol, initial)
#endif
getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol);
- getvvcol(curwin, &(oap->end), &start, NULL, &end);
- if (start < oap->start_vcol)
- oap->start_vcol = start;
- if (end > oap->end_vcol)
+ if (!redo_VIsual_busy)
{
- if (initial && *p_sel == 'e' && start >= 1
- && start - 1 >= oap->end_vcol)
- oap->end_vcol = start - 1;
- else
- oap->end_vcol = end;
+ getvvcol(curwin, &(oap->end), &start, NULL, &end);
+
+ if (start < oap->start_vcol)
+ oap->start_vcol = start;
+ if (end > oap->end_vcol)
+ {
+ if (initial && *p_sel == 'e' && start >= 1
+ && start - 1 >= oap->end_vcol)
+ oap->end_vcol = start - 1;
+ else
+ oap->end_vcol = end;
+ }
}
+
/* if '$' was used, get oap->end_vcol from longest line */
if (curwin->w_curswant == MAXCOL)
{
diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in
index 6af48a75e1..164f12a809 100644
--- a/src/testdir/test_listlbr.in
+++ b/src/testdir/test_listlbr.in
@@ -74,6 +74,12 @@ Golong line: 40afoobar aTARGET at end
:let g:test ="Test 8: set linebreak with visual char mode and changing block"
:$put =g:test
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
:qa!
ENDTEST
diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok
index 82881234c4..323bcdee08 100644
--- a/src/testdir/test_listlbr.ok
+++ b/src/testdir/test_listlbr.ok
@@ -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
Test 8: set linebreak with visual char mode and changing block
1111-2222-1111-11-1111-2222-1111
+Test 9: using redo after block visual mode
+
+AaA
+AaA
+A
diff --git a/src/version.c b/src/version.c
index f6f30b0522..c06287242e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 798,
+/**/
797,
/**/
796,