summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-26 20:44:10 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-26 20:44:10 +0200
commit35d5af6c0b618aef9ca87b05b2e184934e47d916 (patch)
tree13e1e05a10a50c1d95852f2f8846ec613a105252
parent51fe3b14f63da2b985bcd7b4c50fbe34ae84ea48 (diff)
downloadvim-git-35d5af6c0b618aef9ca87b05b2e184934e47d916.tar.gz
patch 8.1.1403: cannot build without the timer featurev8.1.1403
Problem: Cannot build without the timer feature. Solution: Add #ifdef.
-rw-r--r--src/popupwin.c2
-rw-r--r--src/structs.h2
-rw-r--r--src/testdir/test_popupwin.vim4
-rw-r--r--src/version.c2
-rw-r--r--src/window.c4
5 files changed, 14 insertions, 0 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index f08f78435..116efcb23 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -30,6 +30,7 @@ apply_options(win_T *wp, buf_T *buf UNUSED, dict_T *dict)
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)
@@ -49,6 +50,7 @@ apply_options(win_T *wp, buf_T *buf UNUSED, dict_T *dict)
wp->w_popup_timer->tr_partial = tv.vval.v_partial;
}
}
+#endif
}
diff --git a/src/structs.h b/src/structs.h
index 7ead00cea..ca7c54070 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -2874,7 +2874,9 @@ struct window_S
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
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 0f48cbd9a..b6b8a9eaa 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -39,6 +39,9 @@ func Test_simple_popup()
endfunc
func Test_popup_time()
+ if !has('timers')
+ return
+ endif
topleft vnew
call setline(1, 'hello')
@@ -52,6 +55,7 @@ func Test_popup_time()
call assert_equal('world', line)
sleep 700m
+ redraw
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
call assert_equal('hello', line)
diff --git a/src/version.c b/src/version.c
index f974b6b77..4dbff0b2e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1403,
+/**/
1402,
/**/
1401,
diff --git a/src/window.c b/src/window.c
index 2cd35a4cb..95b97d8e6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4859,6 +4859,7 @@ win_unlisted(win_T *wp)
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.
@@ -4867,11 +4868,14 @@ win_unlisted(win_T *wp)
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".