]> granicus.if.org Git - vim/commitdiff
patch 8.1.2313: debugging where a delay comes from is not easy v8.1.2313
authorBram Moolenaar <Bram@vim.org>
Sun, 17 Nov 2019 16:06:33 +0000 (17:06 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 17 Nov 2019 16:06:33 +0000 (17:06 +0100)
Problem:    Debugging where a delay comes from is not easy.
Solution:   Use different values when calling ui_delay().

14 files changed:
src/buffer.c
src/change.c
src/fileio.c
src/gui.c
src/if_xcmdsrv.c
src/insexpand.c
src/main.c
src/normal.c
src/screen.c
src/search.c
src/tag.c
src/term.c
src/ui.c
src/version.c

index f7ff01ff9779b7dd0178dd26d95edf0cbfe12ace..cba84c629acd2538b51811aa517a40c6a15fa846 100644 (file)
@@ -2103,7 +2103,7 @@ buflist_new(
            if (emsg_silent == 0)
            {
                out_flush();
-               ui_delay(3000L, TRUE);  /* make sure it is noticed */
+               ui_delay(3001L, TRUE);  // make sure it is noticed
            }
            top_file_num = 1;
        }
index f2542810ef44975e619f2b1aa1c906255bba2412..e274d5d98f133ea7b8b412e6a0d2515dc881379b 100644 (file)
@@ -58,7 +58,7 @@ change_warning(int col)
                )
        {
            out_flush();
-           ui_delay(1000L, TRUE); // give the user time to think about it
+           ui_delay(1002L, TRUE); // give the user time to think about it
        }
        curbuf->b_did_warn = TRUE;
        redraw_cmdline = FALSE; // don't redraw and erase the message
@@ -118,7 +118,7 @@ changed(void)
            if (need_wait_return && emsg_silent == 0)
            {
                out_flush();
-               ui_delay(2000L, TRUE);
+               ui_delay(2002L, TRUE);
                wait_return(TRUE);
                msg_scroll = save_msg_scroll;
            }
index 85c5e6827fa3ef5e65e46810495a5dab2cce1175..6f8c8f991d7cd33890e3e9730e1addb588952c9e 100644 (file)
@@ -4191,7 +4191,7 @@ buf_check_timestamp(
                        if (!focus)
 #endif
                            /* give the user some time to think about it */
-                           ui_delay(1000L, TRUE);
+                           ui_delay(1004L, TRUE);
 
                        /* don't redraw and erase the message */
                        redraw_cmdline = FALSE;
index 53e073c7ddafee2919f6812acf922376b3e56f1b..94a0503d058c7ad071217a2241d346a34688e8f1 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -279,7 +279,7 @@ gui_do_fork(void)
        }
 
        if (pipe_error)
-           ui_delay(300L, TRUE);
+           ui_delay(301L, TRUE);
 
        /* When swapping screens we may need to go to the next line, e.g.,
         * after a hit-enter prompt and using ":gui". */
index 590491497869660da2c83f9d918fc997d194a154..b884a5bed5da055c951d43612f8bc80c20a265a8 100644 (file)
@@ -556,7 +556,7 @@ ServerWait(
     time_t         now;
     XEvent         event;
 
-#define UI_MSEC_DELAY 50
+#define UI_MSEC_DELAY 53
 #define SEND_MSEC_POLL 500
 #ifndef HAVE_SELECT
     struct pollfd   fds;
index e42819a18d64f49920214dd8d40b24c3a87cf133..121e6ec52d93eb11ac5500809028b97b82434173 100644 (file)
@@ -304,7 +304,7 @@ has_compl_option(int dict_opt)
 #ifdef FEAT_EVAL
            if (!get_vim_var_nr(VV_TESTING))
 #endif
-               ui_delay(2000L, FALSE);
+               ui_delay(2004L, FALSE);
        }
        return FALSE;
     }
index 2ec5c2631793898151828c8c7b9cbbdb650d8cad..103c53c363dd0d4325e990288ba40075d6c2c7c8 100644 (file)
@@ -2769,7 +2769,7 @@ check_tty(mparm_T *parmp)
        if (parmp->tty_fail && (!stdout_isatty || !input_isatty))
            exit(1);
        if (scriptin[0] == NULL)
-           ui_delay(2000L, TRUE);
+           ui_delay(2005L, TRUE);
        TIME_MSG("Warning delay");
     }
 }
index 76b1fa0644a9b952191de02037c7ad0394a7a7fa..363f539c738df7af0c715c59b2771e07dd650609 100644 (file)
@@ -1169,8 +1169,8 @@ getcount:
        cursor_on();
        out_flush();
        if (msg_scroll || emsg_on_display)
-           ui_delay(1000L, TRUE);      /* wait at least one second */
-       ui_delay(3000L, FALSE);         /* wait up to three seconds */
+           ui_delay(1003L, TRUE);      /* wait at least one second */
+       ui_delay(3003L, FALSE);         /* wait up to three seconds */
        State = save_State;
 
        msg_scroll = FALSE;
index 8453c8d8ee061ddef2c2808d792e25e2ee94b477..edb93f8b7879a689fb5b828eb7e3b01314027bdc 100644 (file)
@@ -2406,7 +2406,7 @@ check_for_delay(int check_msg_scroll)
            && emsg_silent == 0)
     {
        out_flush();
-       ui_delay(1000L, TRUE);
+       ui_delay(1006L, TRUE);
        emsg_on_display = FALSE;
        if (check_msg_scroll)
            msg_scroll = FALSE;
index 00f0a08ffea7af83e4e8664a7a9d0ae0ce5008cf..cff289cf5063218678fce1abd8d03736a1083d9e 100644 (file)
@@ -2726,9 +2726,9 @@ showmatch(
             * available.
             */
            if (vim_strchr(p_cpo, CPO_SHOWMATCH) != NULL)
-               ui_delay(p_mat * 100L, TRUE);
+               ui_delay(p_mat * 100L + 8, TRUE);
            else if (!char_avail())
-               ui_delay(p_mat * 100L, FALSE);
+               ui_delay(p_mat * 100L + 9, FALSE);
            curwin->w_cursor = save_cursor;     /* restore cursor position */
            *so = save_so;
            *siso = save_siso;
index b72d82bf53a21dd7c3d7a5d038acb2c1c3d078a3..040325c6278991682fe2df7011df1a9f20e3dee2 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -738,7 +738,7 @@ do_tag(
                if (ic && !msg_scrolled && msg_silent == 0)
                {
                    out_flush();
-                   ui_delay(1000L, TRUE);
+                   ui_delay(1007L, TRUE);
                }
            }
 
@@ -3599,7 +3599,7 @@ jumpto_tag(
                        if (!msg_scrolled && msg_silent == 0)
                        {
                            out_flush();
-                           ui_delay(1000L, TRUE);
+                           ui_delay(1010L, TRUE);
                        }
                    }
                    retval = OK;
index 94552a631d34d0a43e0fb37dc565922e2f672974..5b8901ed1285b7985822ea8dcfbc30a5883caa94 100644 (file)
@@ -1761,7 +1761,7 @@ report_default_term(char_u *term)
        screen_start(); /* don't know where cursor is now */
        out_flush();
        if (!is_not_a_term())
-           ui_delay(2000L, TRUE);
+           ui_delay(2007L, TRUE);
     }
 }
 
@@ -2810,7 +2810,7 @@ term_get_winpos(int *x, int *y, varnumber_T timeout)
            *y = winpos_y;
            return OK;
        }
-       ui_delay(10, FALSE);
+       ui_delay(10L, FALSE);
     }
     /* Do not reset "did_request_winpos", if we timed out the response might
      * still come later and we must consume it. */
index 2d33f7b3047bcfecee4669e8682f4aab46d4cb05..cde97c3f30ca46525934fe60f9388a97dd8b6a6c 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -532,6 +532,9 @@ ui_char_avail(void)
     void
 ui_delay(long msec, int ignoreinput)
 {
+#ifdef FEAT_JOB_CHANNEL
+    ch_log(NULL, "ui_delay(%ld)", msec);
+#endif
 #ifdef FEAT_GUI
     if (gui.in_use && !ignoreinput)
        gui_wait_for_chars(msec, typebuf.tb_change_cnt);
index 2f0316fae7f29220e0c003aaeff3332072132b22..cfd58460a892254905e94b172cfd2e930cb94dc5 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2313,
 /**/
     2312,
 /**/