mirror of
https://github.com/vim/vim.git
synced 2025-10-28 09:27:14 -04:00
patch 9.1.1795: Vim9: popup_show() may return void
Problem: Vim9: popup_show() may return void
Solution: Modify popup_show() to return -1 for an invalid popup window
id (Yegappan Lakshmanan).
fixes: #18389
closes: #18401
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
7bb733f6bf
commit
773054b976
@@ -2832,6 +2832,9 @@ f_popup_show(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
int id;
|
||||
win_T *wp;
|
||||
|
||||
rettv->v_type = VAR_NUMBER;
|
||||
rettv->vval.v_number = -1;
|
||||
|
||||
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
@@ -2846,6 +2849,8 @@ f_popup_show(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
if (wp->w_popup_flags & POPF_INFO)
|
||||
pum_position_info_popup(wp);
|
||||
#endif
|
||||
|
||||
rettv->vval.v_number = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user