diff src/search.c @ 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 8f6df2f6d2fc
children 654fc5636b37
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();