aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-09-24 09:48:52 +0800
committerckelsel <ckelsel@hotmail.com>2017-09-24 10:00:53 +0800
commit006425b8b683711cfb4f89074034ec1fe2085d40 (patch)
tree43b6bd31a3939ac32bc41b1c24f43a20dbd01d2a /src
parent4bb0e95abbf0a61d383d5261019a2667706c9d39 (diff)
downloadrneovim-006425b8b683711cfb4f89074034ec1fe2085d40.tar.gz
rneovim-006425b8b683711cfb4f89074034ec1fe2085d40.tar.bz2
rneovim-006425b8b683711cfb4f89074034ec1fe2085d40.zip
vim-patch:8.0.0330
Problem: Illegal memory access after "vapo". (Dominique Pelle) Solution: Fix the cursor column. https://github.com/vim/vim/commit/84b2a381451e9068b09ef6d85f5e8cf1598e7355
Diffstat (limited to 'src')
-rw-r--r--src/nvim/search.c12
-rw-r--r--src/nvim/testdir/test_visual.vim7
-rw-r--r--src/nvim/version.c2
3 files changed, 16 insertions, 5 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 1bf2317d2a..387614fd09 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -3557,11 +3557,15 @@ extend:
--start_lnum;
if (VIsual_active) {
- /* Problem: when doing "Vipipip" nothing happens in a single white
- * line, we get stuck there. Trap this here. */
- if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum)
+ // Problem: when doing "Vipipip" nothing happens in a single white
+ // line, we get stuck there. Trap this here.
+ if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum) {
goto extend;
- VIsual.lnum = start_lnum;
+ }
+ if (VIsual.lnum != start_lnum) {
+ VIsual.lnum = start_lnum;
+ VIsual.col = 0;
+ }
VIsual_mode = 'V';
redraw_curbuf_later(INVERTED); /* update the inversion */
showmode();
diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim
index 74c26e3d66..8cb59ca32a 100644
--- a/src/nvim/testdir/test_visual.vim
+++ b/src/nvim/testdir/test_visual.vim
@@ -28,3 +28,10 @@ func Test_Visual_ctrl_o()
set tw&
bw!
endfu
+
+func Test_Visual_vapo()
+ new
+ normal oxx
+ normal vapo
+ bwipe!
+endfunc
diff --git a/src/nvim/version.c b/src/nvim/version.c
index d4f9c0232f..b642777d8a 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -622,7 +622,7 @@ static const int included_patches[] = {
// 333,
// 332,
331,
- // 330,
+ 330,
// 329,
// 328,
327,