]> granicus.if.org Git - vim/commitdiff
patch 8.0.0339: illegal memory access with vi' v8.0.0339
authorBram Moolenaar <Bram@vim.org>
Sat, 18 Feb 2017 22:12:01 +0000 (23:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 18 Feb 2017 22:12:01 +0000 (23:12 +0100)
Problem:    Illegal memory access with vi'
Solution:   For quoted text objects bail out if the Visual area spans more
            than one line.

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

index 6e62184d409dae3f9d96e77b0a0922a4271f18b3..83c584272c44deadd072afc83c98656f9660f7b1 100644 (file)
@@ -4357,6 +4357,10 @@ current_quote(
     /* Correct cursor when 'selection' is exclusive */
     if (VIsual_active)
     {
+       /* this only works within one line */
+       if (VIsual.lnum != curwin->w_cursor.lnum)
+           return FALSE;
+
        vis_bef_curs = lt(VIsual, curwin->w_cursor);
        if (*p_sel == 'e' && vis_bef_curs)
            dec_cursor();
index 9d093d34e3e2d8d61ed962114f876e5fceced463..227da87f830c0d207614d3864078ce68c779a27a 100644 (file)
@@ -43,3 +43,10 @@ func Test_Visual_vapo()
   normal vapo
   bwipe!
 endfunc
+
+func Test_Visual_inner_quote()
+  new
+  normal oxX
+  normal vki'
+  bwipe!
+endfunc
index aac6dae6785499971ef47542a135eddf660a8b5e..41a0321edb327cbc5f21481a8ca59a68e61f1a6d 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    339,
 /**/
     338,
 /**/