]> granicus.if.org Git - vim/commitdiff
patch 8.0.0330: illegal memory access after "vapo" v8.0.0330
authorBram Moolenaar <Bram@vim.org>
Fri, 17 Feb 2017 10:40:00 +0000 (11:40 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 17 Feb 2017 10:40:00 +0000 (11:40 +0100)
Problem:    Illegal memory access after "vapo". (Dominique Pelle)
Solution:   Fix the cursor column.

src/search.c
src/testdir/test_visual.vim
src/version.c

index 36410e50fadc5ab10a5dcf0fa508e58d4d5cb49e..6e62184d409dae3f9d96e77b0a0922a4271f18b3 100644 (file)
@@ -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();
index 8768395ba11be66b276e9337b09d5dc5707ae9ad..9d093d34e3e2d8d61ed962114f876e5fceced463 100644 (file)
@@ -36,3 +36,10 @@ func Test_Visual_ctrl_o()
   set tw&
   bw!
 endfu
+
+func Test_Visual_vapo()
+  new
+  normal oxx
+  normal vapo
+  bwipe!
+endfunc
index 9073c07dc8883d4459f3093b6274d8c28601ebdc..906c30c93f6e6da1c8cc1a7b6b185eae980d6710 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    330,
 /**/
     329,
 /**/