aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-15 10:23:27 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-15 10:26:39 +0800
commit6eec30ccfc09f0ea45c9ef86a77ca92a5fc4a1b9 (patch)
tree68a5a7fd697f5da9f4727294cb1450deefb5a634 /src/nvim/window.c
parent1bd6c0a05c18e10e9439b4090e6f57f0d1e1fc21 (diff)
downloadrneovim-6eec30ccfc09f0ea45c9ef86a77ca92a5fc4a1b9.tar.gz
rneovim-6eec30ccfc09f0ea45c9ef86a77ca92a5fc4a1b9.tar.bz2
rneovim-6eec30ccfc09f0ea45c9ef86a77ca92a5fc4a1b9.zip
vim-patch:8.2.4154: ml_get error when exchanging windows in Visual mode
Problem: ml_get error when exchanging windows in Visual mode. Solution: Correct end of Visual area when entering another buffer. https://github.com/vim/vim/commit/05b27615481e72e3b338bb12990fb3e0c2ecc2a9
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index e09af7a7bb..1e737d2083 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -1727,6 +1727,12 @@ static void win_exchange(long Prenum)
(void)win_comp_pos(); // recompute window positions
+ if (wp->w_buffer != curbuf) {
+ reset_VIsual_and_resel();
+ } else if (VIsual_active) {
+ wp->w_cursor = curwin->w_cursor;
+ }
+
win_enter(wp, true);
redraw_later(curwin, NOT_VALID);
redraw_later(wp, NOT_VALID);