aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraichoo <raichoo@googlemail.com>2017-03-11 13:42:06 +0100
committerraichoo <raichoo@googlemail.com>2017-03-19 21:14:11 +0100
commit86b1e7f5834d58eebc87735c9a531040fea1a0f7 (patch)
tree684d0cf0981fa2e68c76d0ef074495193e87dc8d
parenta4f20db08ce2824d3a63b5ae50aabbea14830ac2 (diff)
downloadrneovim-86b1e7f5834d58eebc87735c9a531040fea1a0f7.tar.gz
rneovim-86b1e7f5834d58eebc87735c9a531040fea1a0f7.tar.bz2
rneovim-86b1e7f5834d58eebc87735c9a531040fea1a0f7.zip
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
-rw-r--r--src/nvim/buffer.c4
-rw-r--r--src/nvim/ex_docmd.c1
-rw-r--r--src/nvim/version.c2
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