Problem: Cannot build without the timer feature.
Solution: Add #ifdef.
wp->w_wincol = dict_get_number(dict, (char_u *)"col");
wp->w_zindex = dict_get_number(dict, (char_u *)"zindex");
+#if defined(FEAT_TIMERS)
// Add timer to close the popup after some time.
nr = dict_get_number(dict, (char_u *)"time");
if (nr > 0)
wp->w_popup_timer->tr_partial = tv.vval.v_partial;
}
}
+#endif
}
int w_zindex;
int w_maxheight; // "maxheight" for popup window
int w_maxwidth; // "maxwidth" for popup window
+# if defined(FEAT_TIMERS)
timer_T *w_popup_timer; // timer for closing popup window
+# endif
#endif
endfunc
func Test_popup_time()
+ if !has('timers')
+ return
+ endif
topleft vnew
call setline(1, 'hello')
call assert_equal('world', line)
sleep 700m
+ redraw
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
call assert_equal('hello', line)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1403,
/**/
1402,
/**/
return wp == aucmd_win || bt_popup(wp->w_buffer);
}
+#if defined(FEAT_TEXT_PROP) || defined(PROTO)
/*
* Free a popup window. This does not take the window out of the window list
* and assumes there is only one toplevel frame, no split.
win_free_popup(win_T *win)
{
win_close_buffer(win, TRUE, FALSE);
+# if defined(FEAT_TIMERS)
if (win->w_popup_timer != NULL)
stop_timer(win->w_popup_timer);
+# endif
vim_free(win->w_frame);
win_free(win, NULL);
}
+#endif
/*
* Append window "wp" in the window list after window "after".