aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/window.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-10 20:13:40 +0800
committerGitHub <noreply@github.com>2022-12-10 20:13:40 +0800
commit224473546c95f17c45afc54fe8b4ef5f0e000974 (patch)
treefec868e826d41d56c556eb552c7fbde78d91cac9 /src/nvim/api/window.c
parent6d37d8cb17390419360c1459607beac2d93183b6 (diff)
downloadrneovim-224473546c95f17c45afc54fe8b4ef5f0e000974.tar.gz
rneovim-224473546c95f17c45afc54fe8b4ef5f0e000974.tar.bz2
rneovim-224473546c95f17c45afc54fe8b4ef5f0e000974.zip
fix(api): set correct curbuf when temporarily changing curwin (#21371)
This is the same code change as https://github.com/vim/vim/commit/6c87bbb4e45515e70ac1728cabd1451063bf427d
Diffstat (limited to 'src/nvim/api/window.c')
-rw-r--r--src/nvim/api/window.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index 60fbc55363..df8ad165ba 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -169,9 +169,11 @@ void nvim_win_set_height(Window window, Integer height, Error *err)
win_T *savewin = curwin;
curwin = win;
+ curbuf = curwin->w_buffer;
try_start();
win_setheight((int)height);
curwin = savewin;
+ curbuf = curwin->w_buffer;
try_end(err);
}
@@ -214,9 +216,11 @@ void nvim_win_set_width(Window window, Integer width, Error *err)
win_T *savewin = curwin;
curwin = win;
+ curbuf = curwin->w_buffer;
try_start();
win_setwidth((int)width);
curwin = savewin;
+ curbuf = curwin->w_buffer;
try_end(err);
}