]> granicus.if.org Git - vim/commitdiff
patch 8.2.1578: Vim9: popup_clear() does not take "true" as argument v8.2.1578
authorBram Moolenaar <Bram@vim.org>
Wed, 2 Sep 2020 20:33:24 +0000 (22:33 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 2 Sep 2020 20:33:24 +0000 (22:33 +0200)
Problem:    Vim9: popup_clear() does not take "true" as argument.
Solution:   Use tv_get_bool(). (closes #6826)

src/popupwin.c
src/testdir/test_popupwin.vim
src/version.c

index 053d6d3fd8c61e164eedfe3aae5563cae612a807..953e76cc7e3679456160fd25f117d29cf69c89f2 100644 (file)
@@ -2125,7 +2125,7 @@ f_popup_clear(typval_T *argvars, typval_T *rettv UNUSED)
     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);
 }
 
index 1aebe058f7a088878f62c5e3bb51e5b1722e1eae..9e35c7ffc7f3bfb8fe6a6e51725edba9ac3d17f5 100644 (file)
@@ -2559,20 +2559,23 @@ endfunc
 
 func Test_popupwin_close_prevwin()
   CheckFeature terminal
+  call Popupwin_close_prevwin()
+endfunc
 
-  call assert_equal(1, winnr('$'))
+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
index 5232e8485cb2543471e22107e88e30d5d3b26d32..12d49bbcf03aea601a1e8c7d360caee7ae59d1d0 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1578,
 /**/
     1577,
 /**/