aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/search.c
diff options
context:
space:
mode:
authorKunMing Xie <qqzz014@gmail.com>2018-01-01 23:08:26 +0800
committerJustin M. Keyes <justinkz@gmail.com>2018-01-01 16:08:26 +0100
commit1d8c612f788b1a5c8d74814db4654462e0224831 (patch)
tree22db9a8729e2956e4b5c4cc24a3283f6c919906b /src/nvim/search.c
parent907b2f18f7c35eb289357aa08e00178562b65a42 (diff)
downloadrneovim-1d8c612f788b1a5c8d74814db4654462e0224831.tar.gz
rneovim-1d8c612f788b1a5c8d74814db4654462e0224831.tar.bz2
rneovim-1d8c612f788b1a5c8d74814db4654462e0224831.zip
vim-patch:8.0.0339: illegal memory access with vi' (#7794)
Problem: Illegal memory access with vi' Solution: For quoted text objects bail out if the Visual area spans more than one line. https://github.com/vim/vim/commit/46522af72424c7fadfa7a4cbba3dd21b82d19131
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r--src/nvim/search.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 387614fd09..1eb1a25a19 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -3669,6 +3669,11 @@ 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();