To: vim_dev@googlegroups.com Subject: Patch 8.1.1433 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1433 Problem: Win_execute() may leave popup window focused, eventually leading to a crash. (Bjorn Linse) Solution: When previous window was closed, go to the first window. Files: src/window.c, src/testdir/test_popupwin.vim *** ../vim-8.1.1432/src/window.c 2019-05-30 17:29:34.767666654 +0200 --- src/window.c 2019-05-31 17:34:12.407650227 +0200 *************** *** 6573,6578 **** --- 6573,6584 ---- curwin = save_curwin; curbuf = curwin->w_buffer; } + #ifdef FEAT_TEXT_PROP + else if (bt_popup(curwin->w_buffer)) + // original window was closed and now we're in a popup window: Go + // to the first valid window. + win_goto(firstwin); + #endif } /* *** ../vim-8.1.1432/src/testdir/test_popupwin.vim 2019-05-30 22:32:10.804178558 +0200 --- src/testdir/test_popupwin.vim 2019-05-31 17:33:42.747822549 +0200 *************** *** 105,110 **** --- 105,118 ---- call delete('XtestPopup') endfunc + func Test_win_execute_closing_curwin() + split + let winid = popup_create('some text', {}) + call win_execute(winid, winnr() .. "close") + call assert_equal(1, winnr()) + popupclear + endfunc + func Test_popup_with_wrap() if !CanRunVimInTerminal() return *** ../vim-8.1.1432/src/version.c 2019-05-30 22:35:15.151191862 +0200 --- src/version.c 2019-05-31 17:23:30.627380604 +0200 *************** *** 769,770 **** --- 769,772 ---- { /* Add new patch number below this line */ + /**/ + 1433, /**/ -- Time is money. Especially if you make clocks. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///