aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2016-02-02 18:21:32 +0100
committerJurica Bradaric <jbradaric@gmail.com>2016-02-02 18:29:23 +0100
commitffd143be824ca96db1777c903b10696f06326a01 (patch)
tree5000d1873a633b3b6f8d536ddb32b753be5a9106 /src
parent5308585adf8140e232602c96e22909371736d826 (diff)
downloadrneovim-ffd143be824ca96db1777c903b10696f06326a01.tar.gz
rneovim-ffd143be824ca96db1777c903b10696f06326a01.tar.bz2
rneovim-ffd143be824ca96db1777c903b10696f06326a01.zip
vim-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) https://github.com/vim/vim/commit/31b259bf9571cae6408be3ef75d9485e24029be5
Diffstat (limited to 'src')
-rw-r--r--src/nvim/normal.c25
-rw-r--r--src/nvim/testdir/test_listlbr.in6
-rw-r--r--src/nvim/testdir/test_listlbr.ok5
-rw-r--r--src/nvim/version.c2
4 files changed, 26 insertions, 12 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 9a9cf50e48..4458c8bd5b 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -7798,20 +7798,23 @@ static void get_op_vcol(
}
getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol);
- getvvcol(curwin, &(oap->end), &start, NULL, &end);
+ if (!redo_VIsual_busy) {
+ 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 (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) {
curwin->w_cursor.col = MAXCOL;
diff --git a/src/nvim/testdir/test_listlbr.in b/src/nvim/testdir/test_listlbr.in
index 57202b46eb..f13eee121e 100644
--- a/src/nvim/testdir/test_listlbr.in
+++ b/src/nvim/testdir/test_listlbr.in
@@ -75,6 +75,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/nvim/testdir/test_listlbr.ok b/src/nvim/testdir/test_listlbr.ok
index 82881234c4..323bcdee08 100644
--- a/src/nvim/testdir/test_listlbr.ok
+++ b/src/nvim/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/nvim/version.c b/src/nvim/version.c
index 33211cdf14..228bc6a6d0 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -490,7 +490,7 @@ static int included_patches[] = {
// 801,
// 800,
799,
- // 798,
+ 798,
// 797,
// 796 NA
795,