blob: c9265367bfca1d81f9c6a55a3e08d14f1a0d3706 [file] [log] [blame]
Bram Moolenaar4d784b22019-05-25 19:51:39 +02001/* vi:set ts=8 sts=4 sw=4 noet:
2 *
3 * VIM - Vi IMproved by Bram Moolenaar
4 *
5 * Do ":help uganda" in Vim to read a list of people who contributed.
6 * Do ":help credits" in Vim to see a list of people who contributed.
7 * See README.txt for an overview of the Vim source code.
8 */
9
10/*
11 * Implementation of popup windows. See ":help popup".
12 */
13
14#include "vim.h"
15
16#ifdef FEAT_TEXT_PROP
17
18/*
19 * Go through the options in "dict" and apply them to buffer "buf" displayed in
20 * popup window "wp".
21 */
22 static void
23apply_options(win_T *wp, buf_T *buf UNUSED, dict_T *dict)
24{
Bram Moolenaar51fe3b12019-05-26 20:10:06 +020025 int nr;
Bram Moolenaar20c023a2019-05-26 21:03:24 +020026 char_u *str;
Bram Moolenaar51fe3b12019-05-26 20:10:06 +020027
Bram Moolenaar60cdb302019-05-27 21:54:10 +020028 wp->w_minwidth = dict_get_number(dict, (char_u *)"minwidth");
29 wp->w_minheight = dict_get_number(dict, (char_u *)"minheight");
Bram Moolenaar4d784b22019-05-25 19:51:39 +020030 wp->w_maxwidth = dict_get_number(dict, (char_u *)"maxwidth");
31 wp->w_maxheight = dict_get_number(dict, (char_u *)"maxheight");
Bram Moolenaar60cdb302019-05-27 21:54:10 +020032
33 wp->w_wantline = dict_get_number(dict, (char_u *)"line");
34 wp->w_wantcol = dict_get_number(dict, (char_u *)"col");
35
Bram Moolenaar4d784b22019-05-25 19:51:39 +020036 wp->w_zindex = dict_get_number(dict, (char_u *)"zindex");
Bram Moolenaar51fe3b12019-05-26 20:10:06 +020037
Bram Moolenaar35d5af62019-05-26 20:44:10 +020038#if defined(FEAT_TIMERS)
Bram Moolenaar51fe3b12019-05-26 20:10:06 +020039 // Add timer to close the popup after some time.
40 nr = dict_get_number(dict, (char_u *)"time");
41 if (nr > 0)
42 {
43 char_u cbbuf[50];
44 char_u *ptr = cbbuf;
45 typval_T tv;
46
47 vim_snprintf((char *)cbbuf, sizeof(cbbuf),
48 "{_ -> popup_close(%d)}", wp->w_id);
49 if (get_lambda_tv(&ptr, &tv, TRUE) == OK)
50 {
51 wp->w_popup_timer = create_timer(nr, 0);
52 wp->w_popup_timer->tr_callback =
53 vim_strsave(partial_name(tv.vval.v_partial));
54 func_ref(wp->w_popup_timer->tr_callback);
55 wp->w_popup_timer->tr_partial = tv.vval.v_partial;
56 }
57 }
Bram Moolenaar35d5af62019-05-26 20:44:10 +020058#endif
Bram Moolenaar51fe3b12019-05-26 20:10:06 +020059
Bram Moolenaar20c023a2019-05-26 21:03:24 +020060 str = dict_get_string(dict, (char_u *)"highlight", TRUE);
61 if (str != NULL)
62 set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1,
63 str, OPT_FREE|OPT_LOCAL, 0);
Bram Moolenaar4d784b22019-05-25 19:51:39 +020064}
65
66/*
Bram Moolenaar7a8d0272019-05-26 23:32:06 +020067 * Add lines to the popup from a list of strings.
68 */
69 static void
70add_popup_strings(buf_T *buf, list_T *l)
71{
72 listitem_T *li;
73 linenr_T lnum = 0;
74 char_u *p;
75
76 for (li = l->lv_first; li != NULL; li = li->li_next)
77 if (li->li_tv.v_type == VAR_STRING)
78 {
79 p = li->li_tv.vval.v_string;
80 ml_append_buf(buf, lnum++,
81 p == NULL ? (char_u *)"" : p, (colnr_T)0, TRUE);
82 }
83}
84
85/*
86 * Add lines to the popup from a list of dictionaries.
87 */
88 static void
89add_popup_dicts(buf_T *buf, list_T *l)
90{
91 listitem_T *li;
92 listitem_T *pli;
93 linenr_T lnum = 0;
94 char_u *p;
95 dict_T *dict;
96
97 // first add the text lines
98 for (li = l->lv_first; li != NULL; li = li->li_next)
99 {
100 if (li->li_tv.v_type != VAR_DICT)
101 {
102 emsg(_(e_dictreq));
103 return;
104 }
105 dict = li->li_tv.vval.v_dict;
106 p = dict == NULL ? NULL
107 : dict_get_string(dict, (char_u *)"text", FALSE);
108 ml_append_buf(buf, lnum++,
109 p == NULL ? (char_u *)"" : p, (colnr_T)0, TRUE);
110 }
111
112 // add the text properties
113 lnum = 1;
114 for (li = l->lv_first; li != NULL; li = li->li_next, ++lnum)
115 {
116 dictitem_T *di;
117 list_T *plist;
118
119 dict = li->li_tv.vval.v_dict;
120 di = dict_find(dict, (char_u *)"props", -1);
121 if (di != NULL)
122 {
123 if (di->di_tv.v_type != VAR_LIST)
124 {
125 emsg(_(e_listreq));
126 return;
127 }
128 plist = di->di_tv.vval.v_list;
129 if (plist != NULL)
130 {
131 for (pli = plist->lv_first; pli != NULL; pli = pli->li_next)
132 {
133 if (pli->li_tv.v_type != VAR_DICT)
134 {
135 emsg(_(e_dictreq));
136 return;
137 }
138 dict = pli->li_tv.vval.v_dict;
139 if (dict != NULL)
140 {
141 int col = dict_get_number(dict, (char_u *)"col");
142
143 prop_add_common( lnum, col, dict, buf, NULL);
144 }
145 }
146 }
147 }
148 }
149}
150
151/*
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200152 * Adjust the position and size of the popup to fit on the screen.
153 */
Bram Moolenaar17146962019-05-30 00:12:11 +0200154 void
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200155popup_adjust_position(win_T *wp)
156{
Bram Moolenaar88c4e1f2019-05-29 23:14:28 +0200157 linenr_T lnum;
158 int wrapped = 0;
159 int maxwidth;
160
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200161 // TODO: Compute the size and position properly.
162 if (wp->w_wantline > 0)
163 wp->w_winrow = wp->w_wantline - 1;
164 else
165 // TODO: better default
166 wp->w_winrow = Rows > 5 ? Rows / 2 - 2 : 0;
167 if (wp->w_winrow >= Rows)
168 wp->w_winrow = Rows - 1;
169
170 if (wp->w_wantcol > 0)
171 wp->w_wincol = wp->w_wantcol - 1;
172 else
173 // TODO: better default
174 wp->w_wincol = Columns > 20 ? Columns / 2 - 10 : 0;
175 if (wp->w_wincol >= Columns - 3)
176 wp->w_wincol = Columns - 3;
177
Bram Moolenaar88c4e1f2019-05-29 23:14:28 +0200178 maxwidth = Columns - wp->w_wincol;
179 if (wp->w_maxwidth > 0 && maxwidth > wp->w_maxwidth)
180 maxwidth = wp->w_maxwidth;
181
182 // Compute width based on longest text line and the 'wrap' option.
183 // TODO: more accurate wrapping
184 wp->w_width = 0;
185 for (lnum = 1; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum)
186 {
187 int len = vim_strsize(ml_get_buf(wp->w_buffer, lnum, FALSE));
188
189 while (wp->w_p_wrap && len > maxwidth)
190 {
191 ++wrapped;
192 len -= maxwidth;
193 wp->w_width = maxwidth;
194 }
195 if (wp->w_width < len)
196 wp->w_width = len;
197 }
198
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200199 if (wp->w_minwidth > 0 && wp->w_width < wp->w_minwidth)
200 wp->w_width = wp->w_minwidth;
Bram Moolenaar88c4e1f2019-05-29 23:14:28 +0200201 if (wp->w_width > maxwidth)
202 wp->w_width = maxwidth;
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200203
204 if (wp->w_height <= 1)
Bram Moolenaar88c4e1f2019-05-29 23:14:28 +0200205 wp->w_height = wp->w_buffer->b_ml.ml_line_count + wrapped;
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200206 if (wp->w_minheight > 0 && wp->w_height < wp->w_minheight)
207 wp->w_height = wp->w_minheight;
208 if (wp->w_maxheight > 0 && wp->w_height > wp->w_maxheight)
209 wp->w_height = wp->w_maxheight;
210 if (wp->w_height > Rows - wp->w_winrow)
211 wp->w_height = Rows - wp->w_winrow;
Bram Moolenaar17146962019-05-30 00:12:11 +0200212
213 wp->w_popup_last_changedtick = CHANGEDTICK(wp->w_buffer);
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200214}
215
216/*
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200217 * popup_create({text}, {options})
218 */
219 void
220f_popup_create(typval_T *argvars, typval_T *rettv)
221{
222 win_T *wp;
223 buf_T *buf;
224 dict_T *d;
225 int nr;
226
227 // Check arguments look OK.
228 if (!(argvars[0].v_type == VAR_STRING
229 && argvars[0].vval.v_string != NULL
230 && STRLEN(argvars[0].vval.v_string) > 0)
231 && !(argvars[0].v_type == VAR_LIST
232 && argvars[0].vval.v_list != NULL
233 && argvars[0].vval.v_list->lv_len > 0))
234 {
235 emsg(_(e_listreq));
236 return;
237 }
238 if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
239 {
240 emsg(_(e_dictreq));
241 return;
242 }
243 d = argvars[1].vval.v_dict;
244
245 // Create the window and buffer.
246 wp = win_alloc_popup_win();
247 if (wp == NULL)
248 return;
249 rettv->vval.v_number = wp->w_id;
250 wp->w_p_wrap = TRUE; // 'wrap' is default on
251
252 buf = buflist_new(NULL, NULL, (linenr_T)0, BLN_NEW|BLN_LISTED|BLN_DUMMY);
253 if (buf == NULL)
254 return;
255 ml_open(buf);
Bram Moolenaarcacc6a52019-05-30 15:22:43 +0200256
257 win_init_popup_win(wp, buf);
258
259 set_local_options_default(wp);
Bram Moolenaar20c023a2019-05-26 21:03:24 +0200260 set_string_option_direct_in_buf(buf, (char_u *)"buftype", -1,
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200261 (char_u *)"popup", OPT_FREE|OPT_LOCAL, 0);
Bram Moolenaar20c023a2019-05-26 21:03:24 +0200262 set_string_option_direct_in_buf(buf, (char_u *)"bufhidden", -1,
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200263 (char_u *)"hide", OPT_FREE|OPT_LOCAL, 0);
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200264 buf->b_p_ul = -1; // no undo
265 buf->b_p_swf = FALSE; // no swap file
266 buf->b_p_bl = FALSE; // unlisted buffer
Bram Moolenaar868b7b62019-05-29 21:44:40 +0200267 buf->b_locked = TRUE;
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200268
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200269 nr = (int)dict_get_number(d, (char_u *)"tab");
270 if (nr == 0)
271 {
272 // popup on current tab
Bram Moolenaar9c27b1c2019-05-26 18:48:13 +0200273 wp->w_next = curtab->tp_first_popupwin;
274 curtab->tp_first_popupwin = wp;
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200275 }
276 else if (nr < 0)
277 {
278 // global popup
279 wp->w_next = first_popupwin;
280 first_popupwin = wp;
281 }
282 else
283 // TODO: find tab page "nr"
284 emsg("Not implemented yet");
285
286 // Add text to the buffer.
287 if (argvars[0].v_type == VAR_STRING)
Bram Moolenaar7a8d0272019-05-26 23:32:06 +0200288 {
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200289 // just a string
290 ml_append_buf(buf, 0, argvars[0].vval.v_string, (colnr_T)0, TRUE);
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200291 }
292 else
Bram Moolenaar7a8d0272019-05-26 23:32:06 +0200293 {
294 list_T *l = argvars[0].vval.v_list;
295
296 if (l->lv_first->li_tv.v_type == VAR_STRING)
297 // list of strings
298 add_popup_strings(buf, l);
299 else
300 // list of dictionaries
301 add_popup_dicts(buf, l);
302 }
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200303
304 // Delete the line of the empty buffer.
305 curbuf = buf;
306 ml_delete(buf->b_ml.ml_line_count, FALSE);
307 curbuf = curwin->w_buffer;
308
309 // Deal with options.
310 apply_options(wp, buf, argvars[1].vval.v_dict);
311
312 // set default values
313 if (wp->w_zindex == 0)
314 wp->w_zindex = 50;
315
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200316 popup_adjust_position(wp);
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200317
318 wp->w_vsep_width = 0;
319
320 redraw_all_later(NOT_VALID);
321}
322
323/*
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200324 * Find the popup window with window-ID "id".
325 * If the popup window does not exist NULL is returned.
326 * If the window is not a popup window, and error message is given.
327 */
328 static win_T *
329find_popup_win(int id)
330{
331 win_T *wp = win_id2wp(id);
332
333 if (wp != NULL && !bt_popup(wp->w_buffer))
334 {
335 semsg(_("E993: window %d is not a popup window"), id);
336 return NULL;
337 }
338 return wp;
339}
340
341/*
342 * Return TRUE if there any popups that are not hidden.
343 */
344 int
345popup_any_visible(void)
346{
347 win_T *wp;
348
349 for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
Bram Moolenaarbf0ecb22019-05-27 10:04:40 +0200350 if ((wp->w_popup_flags & POPF_HIDDEN) == 0)
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200351 return TRUE;
352 for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next)
Bram Moolenaarbf0ecb22019-05-27 10:04:40 +0200353 if ((wp->w_popup_flags & POPF_HIDDEN) == 0)
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200354 return TRUE;
355 return FALSE;
356}
357
358/*
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200359 * popup_close({id})
360 */
361 void
362f_popup_close(typval_T *argvars, typval_T *rettv UNUSED)
363{
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200364 int id = (int)tv_get_number(argvars);
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200365
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200366 popup_close(id);
367}
368
369/*
370 * popup_hide({id})
371 */
372 void
373f_popup_hide(typval_T *argvars, typval_T *rettv UNUSED)
374{
375 int id = (int)tv_get_number(argvars);
376 win_T *wp = find_popup_win(id);
377
Bram Moolenaarbf0ecb22019-05-27 10:04:40 +0200378 if (wp != NULL && (wp->w_popup_flags & POPF_HIDDEN) == 0)
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200379 {
Bram Moolenaarbf0ecb22019-05-27 10:04:40 +0200380 wp->w_popup_flags |= POPF_HIDDEN;
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200381 redraw_all_later(NOT_VALID);
382 }
383}
384
385/*
386 * popup_show({id})
387 */
388 void
389f_popup_show(typval_T *argvars, typval_T *rettv UNUSED)
390{
391 int id = (int)tv_get_number(argvars);
392 win_T *wp = find_popup_win(id);
393
Bram Moolenaarbf0ecb22019-05-27 10:04:40 +0200394 if (wp != NULL && (wp->w_popup_flags & POPF_HIDDEN) != 0)
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200395 {
Bram Moolenaarbf0ecb22019-05-27 10:04:40 +0200396 wp->w_popup_flags &= ~POPF_HIDDEN;
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200397 redraw_all_later(NOT_VALID);
398 }
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200399}
400
Bram Moolenaar51fe3b12019-05-26 20:10:06 +0200401 static void
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200402popup_free(win_T *wp)
Bram Moolenaar51fe3b12019-05-26 20:10:06 +0200403{
Bram Moolenaar868b7b62019-05-29 21:44:40 +0200404 wp->w_buffer->b_locked = FALSE;
Bram Moolenaar51fe3b12019-05-26 20:10:06 +0200405 if (wp->w_winrow + wp->w_height >= cmdline_row)
406 clear_cmdline = TRUE;
407 win_free_popup(wp);
408 redraw_all_later(NOT_VALID);
409}
410
Bram Moolenaarec583842019-05-26 14:11:23 +0200411/*
412 * Close a popup window by Window-id.
413 */
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200414 void
Bram Moolenaarec583842019-05-26 14:11:23 +0200415popup_close(int id)
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200416{
417 win_T *wp;
Bram Moolenaarec583842019-05-26 14:11:23 +0200418 tabpage_T *tp;
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200419 win_T *prev = NULL;
420
Bram Moolenaarec583842019-05-26 14:11:23 +0200421 // go through global popups
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200422 for (wp = first_popupwin; wp != NULL; prev = wp, wp = wp->w_next)
Bram Moolenaarec583842019-05-26 14:11:23 +0200423 if (wp->w_id == id)
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200424 {
425 if (prev == NULL)
426 first_popupwin = wp->w_next;
427 else
428 prev->w_next = wp->w_next;
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200429 popup_free(wp);
Bram Moolenaarec583842019-05-26 14:11:23 +0200430 return;
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200431 }
432
Bram Moolenaarec583842019-05-26 14:11:23 +0200433 // go through tab-local popups
434 FOR_ALL_TABPAGES(tp)
435 popup_close_tabpage(tp, id);
436}
437
438/*
439 * Close a popup window with Window-id "id" in tabpage "tp".
440 */
441 void
442popup_close_tabpage(tabpage_T *tp, int id)
443{
444 win_T *wp;
Bram Moolenaar9c27b1c2019-05-26 18:48:13 +0200445 win_T **root = &tp->tp_first_popupwin;
Bram Moolenaarec583842019-05-26 14:11:23 +0200446 win_T *prev = NULL;
447
Bram Moolenaarec583842019-05-26 14:11:23 +0200448 for (wp = *root; wp != NULL; prev = wp, wp = wp->w_next)
449 if (wp->w_id == id)
450 {
451 if (prev == NULL)
452 *root = wp->w_next;
453 else
454 prev->w_next = wp->w_next;
Bram Moolenaar2cd0dce2019-05-26 22:17:52 +0200455 popup_free(wp);
Bram Moolenaarec583842019-05-26 14:11:23 +0200456 return;
457 }
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200458}
459
460 void
461close_all_popups(void)
462{
463 while (first_popupwin != NULL)
464 popup_close(first_popupwin->w_id);
Bram Moolenaar9c27b1c2019-05-26 18:48:13 +0200465 while (curtab->tp_first_popupwin != NULL)
466 popup_close(curtab->tp_first_popupwin->w_id);
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200467}
468
469 void
470ex_popupclear(exarg_T *eap UNUSED)
471{
472 close_all_popups();
473}
474
Bram Moolenaar60cdb302019-05-27 21:54:10 +0200475/*
476 * popup_move({id}, {options})
477 */
478 void
479f_popup_move(typval_T *argvars, typval_T *rettv UNUSED)
480{
481 dict_T *d;
482 int nr;
483 int id = (int)tv_get_number(argvars);
484 win_T *wp = find_popup_win(id);
485
486 if (wp == NULL)
487 return; // invalid {id}
488
489 if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
490 {
491 emsg(_(e_dictreq));
492 return;
493 }
494 d = argvars[1].vval.v_dict;
495
496 if ((nr = dict_get_number(d, (char_u *)"minwidth")) > 0)
497 wp->w_minwidth = nr;
498 if ((nr = dict_get_number(d, (char_u *)"minheight")) > 0)
499 wp->w_minheight = nr;
500 if ((nr = dict_get_number(d, (char_u *)"maxwidth")) > 0)
501 wp->w_maxwidth = nr;
502 if ((nr = dict_get_number(d, (char_u *)"maxheight")) > 0)
503 wp->w_maxheight = nr;
504 if ((nr = dict_get_number(d, (char_u *)"line")) > 0)
505 wp->w_wantline = nr;
506 if ((nr = dict_get_number(d, (char_u *)"col")) > 0)
507 wp->w_wantcol = nr;
508 // TODO: "pos"
509
510 if (wp->w_winrow + wp->w_height >= cmdline_row)
511 clear_cmdline = TRUE;
512 popup_adjust_position(wp);
513 redraw_all_later(NOT_VALID);
514}
515
Bram Moolenaarbc133542019-05-29 20:26:46 +0200516/*
517 * popup_getposition({id})
518 */
519 void
520f_popup_getposition(typval_T *argvars, typval_T *rettv)
521{
522 dict_T *dict;
523 int id = (int)tv_get_number(argvars);
524 win_T *wp = find_popup_win(id);
525
526 if (rettv_dict_alloc(rettv) == OK)
527 {
528 if (wp == NULL)
529 return; // invalid {id}
530 dict = rettv->vval.v_dict;
531 dict_add_number(dict, "line", wp->w_winrow + 1);
532 dict_add_number(dict, "col", wp->w_wincol + 1);
533 dict_add_number(dict, "width", wp->w_width);
534 dict_add_number(dict, "height", wp->w_height);
Bram Moolenaar8c2a6002019-05-30 14:29:45 +0200535 dict_add_number(dict, "visible",
536 (wp->w_popup_flags & POPF_HIDDEN) == 0);
537 }
538}
539
540/*
541 * f_popup_getoptions({id})
542 */
543 void
544f_popup_getoptions(typval_T *argvars, typval_T *rettv)
545{
546 dict_T *dict;
547 int id = (int)tv_get_number(argvars);
548 win_T *wp = find_popup_win(id);
549
550 if (rettv_dict_alloc(rettv) == OK)
551 {
552 if (wp == NULL)
553 return;
554
555 dict = rettv->vval.v_dict;
556 dict_add_number(dict, "line", wp->w_wantline);
557 dict_add_number(dict, "col", wp->w_wantcol);
558 dict_add_number(dict, "minwidth", wp->w_minwidth);
559 dict_add_number(dict, "minheight", wp->w_minheight);
560 dict_add_number(dict, "maxheight", wp->w_maxheight);
561 dict_add_number(dict, "maxwidth", wp->w_maxwidth);
562 dict_add_number(dict, "zindex", wp->w_zindex);
563# if defined(FEAT_TIMERS)
564 dict_add_number(dict, "time", wp->w_popup_timer != NULL
565 ? (long)wp->w_popup_timer->tr_interval : 0L);
566# endif
Bram Moolenaarbc133542019-05-29 20:26:46 +0200567 }
568}
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200569#endif // FEAT_TEXT_PROP