diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-02-17 11:40:00 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-02-17 11:40:00 +0100 |
commit | 84b2a381451e9068b09ef6d85f5e8cf1598e7355 (patch) | |
tree | 8613cf846d1abb7a5d3b24eca6014235e4d8ab6b /src | |
parent | 10434674821939222bf552d15d93e0132d13badc (diff) | |
download | vim-git-84b2a381451e9068b09ef6d85f5e8cf1598e7355.tar.gz |
patch 8.0.0330: illegal memory access after "vapo"v8.0.0330
Problem: Illegal memory access after "vapo". (Dominique Pelle)
Solution: Fix the cursor column.
Diffstat (limited to 'src')
-rw-r--r-- | src/search.c | 6 | ||||
-rw-r--r-- | src/testdir/test_visual.vim | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c index 36410e50f..6e62184d4 100644 --- a/src/search.c +++ b/src/search.c @@ -4241,7 +4241,11 @@ extend: * 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/testdir/test_visual.vim b/src/testdir/test_visual.vim index 8768395ba..9d093d34e 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim @@ -36,3 +36,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/version.c b/src/version.c index 9073c07dc..906c30c93 100644 --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 330, +/**/ 329, /**/ 328, |