Mercurial > vim
comparison src/if_py_both.h @ 31422:c3c8136ecfa0 v9.0.1044
patch 9.0.1044: setting window height using Python may cause errors
Commit: https://github.com/vim/vim/commit/6c87bbb4e45515e70ac1728cabd1451063bf427d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 10 11:17:11 2022 +0000
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 https://github.com/vim/vim/issues/11687)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 10 Dec 2022 12:30:03 +0100 |
parents | 307f68a41b03 |
children | c517845bd10e |
comparison
equal
deleted
inserted
replaced
31421:8bfc443b5b00 | 31422:c3c8136ecfa0 |
---|---|
4079 #ifdef FEAT_GUI | 4079 #ifdef FEAT_GUI |
4080 need_mouse_correct = TRUE; | 4080 need_mouse_correct = TRUE; |
4081 #endif | 4081 #endif |
4082 savewin = curwin; | 4082 savewin = curwin; |
4083 curwin = self->win; | 4083 curwin = self->win; |
4084 curbuf = curwin->w_buffer; | |
4084 | 4085 |
4085 VimTryStart(); | 4086 VimTryStart(); |
4086 win_setheight((int) height); | 4087 win_setheight((int) height); |
4087 curwin = savewin; | 4088 curwin = savewin; |
4089 curbuf = curwin->w_buffer; | |
4088 if (VimTryEnd()) | 4090 if (VimTryEnd()) |
4089 return -1; | 4091 return -1; |
4090 | 4092 |
4091 return 0; | 4093 return 0; |
4092 } | 4094 } |
4101 #ifdef FEAT_GUI | 4103 #ifdef FEAT_GUI |
4102 need_mouse_correct = TRUE; | 4104 need_mouse_correct = TRUE; |
4103 #endif | 4105 #endif |
4104 savewin = curwin; | 4106 savewin = curwin; |
4105 curwin = self->win; | 4107 curwin = self->win; |
4108 curbuf = curwin->w_buffer; | |
4106 | 4109 |
4107 VimTryStart(); | 4110 VimTryStart(); |
4108 win_setwidth((int) width); | 4111 win_setwidth((int) width); |
4109 curwin = savewin; | 4112 curwin = savewin; |
4113 curbuf = curwin->w_buffer; | |
4110 if (VimTryEnd()) | 4114 if (VimTryEnd()) |
4111 return -1; | 4115 return -1; |
4112 | 4116 |
4113 return 0; | 4117 return 0; |
4114 } | 4118 } |