diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-02 18:21:32 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-02 18:29:23 +0100 |
commit | ffd143be824ca96db1777c903b10696f06326a01 (patch) | |
tree | 5000d1873a633b3b6f8d536ddb32b753be5a9106 /src/nvim/normal.c | |
parent | 5308585adf8140e232602c96e22909371736d826 (diff) | |
download | rneovim-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/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 25 |
1 files changed, 14 insertions, 11 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; |