-*builtin.txt* For Vim version 9.1. Last change: 2025 Sep 24
+*builtin.txt* For Vim version 9.1. Last change: 2025 Sep 26
VIM REFERENCE MANUAL by Bram Moolenaar
popup_setoptions({id}, {options})
none set options for popup window {id}
popup_settext({id}, {text}) none set the text of popup window {id}
-popup_show({id}) none unhide popup window {id}
+popup_show({id}) Number unhide popup window {id}
pow({x}, {y}) Float {x} to the power of {y}
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
printf({fmt}, {expr1}...) String format text
-*popup.txt* For Vim version 9.1. Last change: 2025 Aug 27
+*popup.txt* For Vim version 9.1. Last change: 2025 Sep 26
VIM REFERENCE MANUAL by Bram Moolenaar
popup_show({id}) *popup_show()*
- If {id} is a hidden popup, show it now.
- For {id} see `popup_hide()`.
- If {id} is the info popup it will be positioned next to the
- current popup menu item.
+ Show a hidden popup window identified by {id}.
+ Use {id} as returned by |popup_create()|.
+
+ If the popup is currently hidden, it will be made visible.
+ See |popup_hide()| to hide a popup.
+
+ If {id} refers to an info popup, it will be positioned next to
+ the currently selected item in the popup menu.
+
+ Returns -1 if a popup window with {id} does not exist.
+ Returns 0 on success.
Return type: |Number|
{"popup_settext", 2, 2, FEARG_1, arg2_number_string_or_list,
ret_void, PROP_FUNC(f_popup_settext)},
{"popup_show", 1, 1, FEARG_1, arg1_number,
- ret_void, PROP_FUNC(f_popup_show)},
+ ret_number, PROP_FUNC(f_popup_show)},
{"pow", 2, 2, FEARG_1, arg2_float_or_nr,
ret_float, f_pow},
{"prevnonblank", 1, 1, FEARG_1, arg1_lnum,
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;
if (wp->w_popup_flags & POPF_INFO)
pum_position_info_popup(wp);
#endif
+
+ rettv->vval.v_number = 0;
}
/*
" no error non-existing window
eval 1234234->popup_hide()
- call popup_show(41234234)
+ call assert_equal(-1, popup_show(41234234))
bwipe!
endfunc
exe "normal anot used by filter\<Esc>"
call assert_equal('not used by filter', getline(1))
- call popup_show(winid)
+ call assert_equal(0, popup_show(winid))
call feedkeys('y', "xt")
call assert_equal(1, s:cb_res)
def Test_popup_show()
v9.CheckSourceDefAndScriptFailure(['popup_show("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1'])
v9.CheckSourceDefAndScriptFailure(['popup_show(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1'])
+ v9.CheckSourceDefAndScriptSuccess(['assert_equal(-1, popup_show(100))'])
enddef
def Test_prevnonblank()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1795,
/**/
1794,
/**/