]> granicus.if.org Git - vim/commitdiff
patch 8.1.1403: cannot build without the timer feature v8.1.1403
authorBram Moolenaar <Bram@vim.org>
Sun, 26 May 2019 18:44:10 +0000 (20:44 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 26 May 2019 18:44:10 +0000 (20:44 +0200)
Problem:    Cannot build without the timer feature.
Solution:   Add #ifdef.

src/popupwin.c
src/structs.h
src/testdir/test_popupwin.vim
src/version.c
src/window.c

index f08f784353a8b94cd04323f7a1f175939aaa7756..116efcb23f45049802d8a024abc6c240c6641e22 100644 (file)
@@ -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
 
 }
 
index 7ead00ceacc29929e1b9d037eddfaad00ad36728..ca7c5407039c692bc501d2e74273b269fcca6942 100644 (file)
@@ -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
 
 
index 0f48cbd9a5ac55c82775344be6e81f634de468c6..b6b8a9eaac396a3990b2737ce83bb3f0455e2c9c 100644 (file)
@@ -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)
 
index f974b6b771ec5393a5c5139dd97509c00b54bd38..4dbff0b2e2a9a4fa1e7b94bb65661e185f6f9720 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1403,
 /**/
     1402,
 /**/
index 2cd35a4cbd6643e1b3ee51a3e0e475099237f11b..95b97d8e644d150b3b4f2549884d4a3b9f52f593 100644 (file)
@@ -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".