0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.1044: setting window height using Python may cause errors

Problem:    Setting window height using Python may cause errors.
Solution:   When setting "curwin" also set "curbuf". (closes #11687)
This commit is contained in:
Bram Moolenaar
2022-12-10 11:17:11 +00:00
parent c51a376265
commit 6c87bbb4e4
3 changed files with 24 additions and 0 deletions

View File

@@ -4081,10 +4081,12 @@ WindowSetattr(WindowObject *self, char *name, PyObject *valObject)
#endif
savewin = curwin;
curwin = self->win;
curbuf = curwin->w_buffer;
VimTryStart();
win_setheight((int) height);
curwin = savewin;
curbuf = curwin->w_buffer;
if (VimTryEnd())
return -1;
@@ -4103,10 +4105,12 @@ WindowSetattr(WindowObject *self, char *name, PyObject *valObject)
#endif
savewin = curwin;
curwin = self->win;
curbuf = curwin->w_buffer;
VimTryStart();
win_setwidth((int) width);
curwin = savewin;
curbuf = curwin->w_buffer;
if (VimTryEnd())
return -1;