Skip to content

Commit 62f93f4

Browse files
committed
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 #6826)
1 parent 04d594b commit 62f93f4

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

src/popupwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ f_popup_clear(typval_T *argvars, typval_T *rettv UNUSED)
21252125
int force = FALSE;
21262126

21272127
if (argvars[0].v_type != VAR_UNKNOWN)
2128-
force = (int)tv_get_number(&argvars[0]);
2128+
force = (int)tv_get_bool(&argvars[0]);
21292129
close_all_popups(force);
21302130
}
21312131

src/testdir/test_popupwin.vim

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,20 +2559,23 @@ endfunc
25592559

25602560
func Test_popupwin_close_prevwin()
25612561
CheckFeature terminal
2562+
call Popupwin_close_prevwin()
2563+
endfunc
25622564

2563-
call assert_equal(1, winnr('$'))
2565+
def Popupwin_close_prevwin()
2566+
assert_equal(1, winnr('$'))
25642567
split
25652568
wincmd b
2566-
call assert_equal(2, winnr())
2569+
assert_equal(2, winnr())
25672570
let buf = term_start(&shell, #{hidden: 1})
2568-
call popup_create(buf, {})
2569-
call TermWait(buf, 100)
2570-
call popup_clear(1)
2571-
call assert_equal(2, winnr())
2571+
popup_create(buf, {})
2572+
TermWait(buf, 100)
2573+
popup_clear(true)
2574+
assert_equal(2, winnr())
25722575

25732576
quit
25742577
exe 'bwipe! ' .. buf
2575-
endfunc
2578+
enddef
25762579

25772580
func Test_popupwin_with_buffer_and_filter()
25782581
new Xwithfilter

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1578,
757759
/**/
758760
1577,
759761
/**/

0 commit comments

Comments
 (0)