# HG changeset patch # User Bram Moolenaar # Date 1599079525 -7200 # Node ID f64a16f5bff09428f8b5a1a3a7c366a81e960868 # Parent de723418d0150a9ef054e00ce9cd6ce9e7f01f9b patch 8.2.1578: Vim9: popup_clear() does not take "true" as argument Commit: https://github.com/vim/vim/commit/62f93f4ec9db1deca088bab7783a35306e2ed4cb Author: Bram Moolenaar Date: Wed Sep 2 22:33:24 2020 +0200 patch 8.2.1578: Vim9: popup_clear() does not take "true" as argument Problem: Vim9: popup_clear() does not take "true" as argument. Solution: Use tv_get_bool(). (closes https://github.com/vim/vim/issues/6826) diff --git a/src/popupwin.c b/src/popupwin.c --- a/src/popupwin.c +++ b/src/popupwin.c @@ -2125,7 +2125,7 @@ f_popup_clear(typval_T *argvars, typval_ int force = FALSE; if (argvars[0].v_type != VAR_UNKNOWN) - force = (int)tv_get_number(&argvars[0]); + force = (int)tv_get_bool(&argvars[0]); close_all_popups(force); } diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -2559,20 +2559,23 @@ endfunc func Test_popupwin_close_prevwin() CheckFeature terminal - - call assert_equal(1, winnr('$')) + call Popupwin_close_prevwin() +endfunc + +def Popupwin_close_prevwin() + assert_equal(1, winnr('$')) split wincmd b - call assert_equal(2, winnr()) + assert_equal(2, winnr()) let buf = term_start(&shell, #{hidden: 1}) - call popup_create(buf, {}) - call TermWait(buf, 100) - call popup_clear(1) - call assert_equal(2, winnr()) + popup_create(buf, {}) + TermWait(buf, 100) + popup_clear(true) + assert_equal(2, winnr()) quit exe 'bwipe! ' .. buf -endfunc +enddef func Test_popupwin_with_buffer_and_filter() new Xwithfilter diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1578, +/**/ 1577, /**/ 1576,