Skip to content

Commit

Permalink
patch 8.2.1578: Vim9: popup_clear() does not take "true" as argument
Browse files Browse the repository at this point in the history
Problem:    Vim9: popup_clear() does not take "true" as argument.
Solution:   Use tv_get_bool(). (closes vim#6826)
  • Loading branch information
brammool committed Sep 2, 2020
1 parent 04d594b commit 62f93f4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/popupwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
17 changes: 10 additions & 7 deletions src/testdir/test_popupwin.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1578,
/**/
1577,
/**/
Expand Down

0 comments on commit 62f93f4

Please sign in to comment.