To: vim_dev@googlegroups.com Subject: Patch 9.0.1044 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1044 Problem: Setting window height using Python may cause errors. Solution: When setting "curwin" also set "curbuf". (closes #11687) Files: src/if_py_both.h, src/testdir/test_python3.vim *** ../vim-9.0.1043/src/if_py_both.h 2022-12-08 15:32:11.083034191 +0000 --- src/if_py_both.h 2022-12-10 11:15:57.834222926 +0000 *************** *** 4081,4090 **** --- 4081,4092 ---- #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,4112 **** --- 4105,4116 ---- #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; *** ../vim-9.0.1043/src/testdir/test_python3.vim 2022-09-30 21:57:07.547153409 +0100 --- src/testdir/test_python3.vim 2022-12-10 11:14:56.746215664 +0000 *************** *** 540,545 **** --- 540,563 ---- %bw! endfunc + " This was causing trouble because "curbuf" was not matching curwin->w_buffer + func Test_python3_window_set_height() + enew! + call setline(1, ['aaa', 'bbb', 'ccc']) + call cursor(2, 1) + set foldmethod=expr + new + wincmd w + python3 vim.windows[0].height = 5 + call assert_equal(5, winheight(1)) + + call feedkeys('j', 'xt') + call assert_equal(3, getpos('.')[1]) + + bwipe! + bwipe! + endfunc + " Test for the python List object func Test_python3_list() " Try to convert a null List *** ../vim-9.0.1043/src/version.c 2022-12-10 10:22:25.873096527 +0000 --- src/version.c 2022-12-10 11:16:23.530225875 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1044, /**/ -- Bravely bold Sir Robin, rode forth from Camelot, He was not afraid to die, Oh Brave Sir Robin, He was not at all afraid to be killed in nasty ways Brave, brave, brave, brave Sir Robin. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///