1
0
forked from aniani/vim

patch 8.1.1770: cannot get the window ID of the popup preview window

Problem:    Cannot get the window ID of the popup preview window.
Solution:   Add popup_getpreview().
This commit is contained in:
Bram Moolenaar
2019-07-28 17:57:43 +02:00
parent ac3150d385
commit 56c0c4749d
7 changed files with 33 additions and 2 deletions

View File

@@ -715,6 +715,7 @@ static struct fst
{"popup_filter_yesno", 2, 2, f_popup_filter_yesno},
{"popup_getoptions", 1, 1, f_popup_getoptions},
{"popup_getpos", 1, 1, f_popup_getpos},
{"popup_getpreview", 0, 0, f_popup_getpreview},
{"popup_hide", 1, 1, f_popup_hide},
{"popup_locate", 2, 2, f_popup_locate},
{"popup_menu", 2, 2, f_popup_menu},

View File

@@ -3019,7 +3019,15 @@ popup_find_preview_window(void)
for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next)
if (wp->w_p_pvw)
return wp;
return wp;
return NULL;
}
void
f_popup_getpreview(typval_T *argvars UNUSED, typval_T *rettv)
{
win_T *wp = popup_find_preview_window();
rettv->vval.v_number = wp == NULL ? 0 : wp->w_id;
}
int

View File

@@ -42,6 +42,7 @@ void may_update_popup_mask(int type);
void update_popups(void (*win_update)(win_T *wp));
int set_ref_in_popups(int copyID);
win_T *popup_find_preview_window(void);
void f_popup_getpreview(typval_T *argvars, typval_T *rettv);
int popup_is_popup(win_T *wp);
int popup_create_preview_window(void);
void popup_close_preview(void);

View File

@@ -0,0 +1,14 @@
|o+0&#ffffff0|n|e| @71
|t|w|o| @71
|t|h|r|e@1| @69
|f|o|u|r| @9|╔+0#0000001#ffd7ff255|═@40|X| +0#0000000#ffffff0@17
|f|i|v|e| @9|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
|s|i|x| @10|║+0#0000001#ffd7ff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @18| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
|s|e|v|e|n| @8|║+0#0000001#ffd7ff255|2|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
|f|i|n|d| |t|h|e|w|o|r|d| |s|║+0#0000001#ffd7ff255|3|0| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
|n|i|n|e| @9|╚+0#0000001#ffd7ff255|═@40|╝| +0#0000000#ffffff0@17
|t|h|i|s| |i|s| >a|n|o|t|h|e|r| |w|o|r|d| @54
|~+0#4040ff13&| @73
|~| @73
|~| @73
|:+0#0000000&| @55|1|0|,|9| @9|A|l@1|

View File

@@ -777,6 +777,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1770,
/**/
1769,
/**/