From 86b1e7f5834d58eebc87735c9a531040fea1a0f7 Mon Sep 17 00:00:00 2001 From: raichoo Date: Sat, 11 Mar 2017 13:42:06 +0100 Subject: vim-patch:7.4.2362 Problem: Illegal memory access with ":1@". (Dominique Pelle) Solution: Correct cursor column after setting the line number. Also avoid calling end_visual_mode() when not in Visual mode. https://github.com/vim/vim/commit/4930a76a0357f76a829eafe4985d04cf3ce0e9e0 --- src/nvim/buffer.c | 4 ++-- src/nvim/ex_docmd.c | 1 + src/nvim/version.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 0a95cc9020..f97f05e697 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -441,7 +441,7 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) // When closing the current buffer stop Visual mode before freeing // anything. - if (is_curbuf) { + if (is_curbuf && VIsual_active) { end_visual_mode(); } @@ -1083,7 +1083,7 @@ do_buffer ( } // When closing the current buffer stop Visual mode. - if (buf == curbuf) { + if (buf == curbuf && VIsual_active) { end_visual_mode(); } diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 1234f8e888..bd3b8c204a 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7325,6 +7325,7 @@ static void ex_at(exarg_T *eap) int prev_len = typebuf.tb_len; curwin->w_cursor.lnum = eap->line2; + check_cursor_col(); // Get the register name. No name means use the previous one. int c = *eap->arg; diff --git a/src/nvim/version.c b/src/nvim/version.c index e79d7a0faa..7d44efb401 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -79,7 +79,7 @@ static int included_patches[] = { // 2365 NA // 2364, // 2363 NA - // 2362, + 2362, // 2361 NA // 2360, // 2359 NA -- cgit