changeset 10900:9b4574d95571 v8.0.0339

patch 8.0.0339: illegal memory access with vi' commit https://github.com/vim/vim/commit/46522af72424c7fadfa7a4cbba3dd21b82d19131 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 18 23:12:01 2017 +0100 patch 8.0.0339: illegal memory access with vi' Problem: Illegal memory access with vi' Solution: For quoted text objects bail out if the Visual area spans more than one line.
author Christian Brabandt <cb@256bit.org>
date Sat, 18 Feb 2017 23:15:04 +0100
parents e5f0776667fb
children 886bce9d79d2
files src/search.c src/testdir/test_visual.vim src/version.c
diffstat 3 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -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();
--- a/src/testdir/test_visual.vim
+++ b/src/testdir/test_visual.vim
@@ -43,3 +43,10 @@ func Test_Visual_vapo()
   normal vapo
   bwipe!
 endfunc
+
+func Test_Visual_inner_quote()
+  new
+  normal oxX
+  normal vki'
+  bwipe!
+endfunc
--- 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 */
 /**/
+    339,
+/**/
     338,
 /**/
     337,