From: Bram Moolenaar Date: Fri, 17 Feb 2017 10:40:00 +0000 (+0100) Subject: patch 8.0.0330: illegal memory access after "vapo" X-Git-Tag: v8.0.0330 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84b2a381451e9068b09ef6d85f5e8cf1598e7355;p=vim patch 8.0.0330: illegal memory access after "vapo" Problem: Illegal memory access after "vapo". (Dominique Pelle) Solution: Fix the cursor column. --- 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 @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 330, /**/ 329, /**/