aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
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 /src/nvim/buffer.c
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
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c4
1 files changed, 2 insertions, 2 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();
}