To: vim_dev@googlegroups.com Subject: Patch 8.1.2313 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2313 Problem: Debugging where a delay comes from is not easy. Solution: Use different values when calling ui_delay(). Files: 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 *** ../vim-8.1.2312/src/buffer.c 2019-11-06 23:26:16.973911982 +0100 --- src/buffer.c 2019-11-17 16:34:09.978159045 +0100 *************** *** 2103,2109 **** if (emsg_silent == 0) { out_flush(); ! ui_delay(3000L, TRUE); /* make sure it is noticed */ } top_file_num = 1; } --- 2103,2109 ---- if (emsg_silent == 0) { out_flush(); ! ui_delay(3001L, TRUE); // make sure it is noticed } top_file_num = 1; } *** ../vim-8.1.2312/src/change.c 2019-10-24 22:32:27.692284767 +0200 --- src/change.c 2019-11-17 16:34:45.458010280 +0100 *************** *** 58,64 **** ) { out_flush(); ! ui_delay(1000L, TRUE); // give the user time to think about it } curbuf->b_did_warn = TRUE; redraw_cmdline = FALSE; // don't redraw and erase the message --- 58,64 ---- ) { out_flush(); ! 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,124 **** if (need_wait_return && emsg_silent == 0) { out_flush(); ! ui_delay(2000L, TRUE); wait_return(TRUE); msg_scroll = save_msg_scroll; } --- 118,124 ---- if (need_wait_return && emsg_silent == 0) { out_flush(); ! ui_delay(2002L, TRUE); wait_return(TRUE); msg_scroll = save_msg_scroll; } *** ../vim-8.1.2312/src/fileio.c 2019-11-16 13:50:18.777646751 +0100 --- src/fileio.c 2019-11-17 17:02:57.809146817 +0100 *************** *** 4191,4197 **** if (!focus) #endif /* give the user some time to think about it */ ! ui_delay(1000L, TRUE); /* don't redraw and erase the message */ redraw_cmdline = FALSE; --- 4191,4197 ---- if (!focus) #endif /* give the user some time to think about it */ ! ui_delay(1004L, TRUE); /* don't redraw and erase the message */ redraw_cmdline = FALSE; *** ../vim-8.1.2312/src/gui.c 2019-11-04 22:52:08.366798096 +0100 --- src/gui.c 2019-11-17 16:35:07.369918136 +0100 *************** *** 279,285 **** } if (pipe_error) ! ui_delay(300L, TRUE); /* When swapping screens we may need to go to the next line, e.g., * after a hit-enter prompt and using ":gui". */ --- 279,285 ---- } if (pipe_error) ! 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". */ *** ../vim-8.1.2312/src/if_xcmdsrv.c 2019-05-28 23:08:12.068648696 +0200 --- src/if_xcmdsrv.c 2019-11-17 16:35:34.441804018 +0100 *************** *** 556,562 **** time_t now; XEvent event; ! #define UI_MSEC_DELAY 50 #define SEND_MSEC_POLL 500 #ifndef HAVE_SELECT struct pollfd fds; --- 556,562 ---- time_t now; XEvent event; ! #define UI_MSEC_DELAY 53 #define SEND_MSEC_POLL 500 #ifndef HAVE_SELECT struct pollfd fds; *** ../vim-8.1.2312/src/insexpand.c 2019-11-02 22:54:37.401188829 +0100 --- src/insexpand.c 2019-11-17 16:35:51.909730235 +0100 *************** *** 304,310 **** #ifdef FEAT_EVAL if (!get_vim_var_nr(VV_TESTING)) #endif ! ui_delay(2000L, FALSE); } return FALSE; } --- 304,310 ---- #ifdef FEAT_EVAL if (!get_vim_var_nr(VV_TESTING)) #endif ! ui_delay(2004L, FALSE); } return FALSE; } *** ../vim-8.1.2312/src/main.c 2019-10-29 04:12:38.620582834 +0100 --- src/main.c 2019-11-17 16:36:03.789679989 +0100 *************** *** 2769,2775 **** if (parmp->tty_fail && (!stdout_isatty || !input_isatty)) exit(1); if (scriptin[0] == NULL) ! ui_delay(2000L, TRUE); TIME_MSG("Warning delay"); } } --- 2769,2775 ---- if (parmp->tty_fail && (!stdout_isatty || !input_isatty)) exit(1); if (scriptin[0] == NULL) ! ui_delay(2005L, TRUE); TIME_MSG("Warning delay"); } } *** ../vim-8.1.2312/src/normal.c 2019-11-09 23:26:36.905570965 +0100 --- src/normal.c 2019-11-17 16:36:23.053598404 +0100 *************** *** 1169,1176 **** 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 */ State = save_State; msg_scroll = FALSE; --- 1169,1176 ---- cursor_on(); out_flush(); if (msg_scroll || emsg_on_display) ! ui_delay(1003L, TRUE); /* wait at least one second */ ! ui_delay(3003L, FALSE); /* wait up to three seconds */ State = save_State; msg_scroll = FALSE; *** ../vim-8.1.2312/src/screen.c 2019-11-12 22:33:32.089004066 +0100 --- src/screen.c 2019-11-17 16:36:32.813557020 +0100 *************** *** 2406,2412 **** && emsg_silent == 0) { out_flush(); ! ui_delay(1000L, TRUE); emsg_on_display = FALSE; if (check_msg_scroll) msg_scroll = FALSE; --- 2406,2412 ---- && emsg_silent == 0) { out_flush(); ! ui_delay(1006L, TRUE); emsg_on_display = FALSE; if (check_msg_scroll) msg_scroll = FALSE; *** ../vim-8.1.2312/src/search.c 2019-11-02 23:22:43.305161451 +0100 --- src/search.c 2019-11-17 16:37:56.653200221 +0100 *************** *** 2726,2734 **** * available. */ if (vim_strchr(p_cpo, CPO_SHOWMATCH) != NULL) ! ui_delay(p_mat * 100L, TRUE); else if (!char_avail()) ! ui_delay(p_mat * 100L, FALSE); curwin->w_cursor = save_cursor; /* restore cursor position */ *so = save_so; *siso = save_siso; --- 2726,2734 ---- * available. */ if (vim_strchr(p_cpo, CPO_SHOWMATCH) != NULL) ! ui_delay(p_mat * 100L + 8, TRUE); else if (!char_avail()) ! ui_delay(p_mat * 100L + 9, FALSE); curwin->w_cursor = save_cursor; /* restore cursor position */ *so = save_so; *siso = save_siso; *** ../vim-8.1.2312/src/tag.c 2019-11-17 16:18:26.921689984 +0100 --- src/tag.c 2019-11-17 16:38:19.621102102 +0100 *************** *** 738,744 **** if (ic && !msg_scrolled && msg_silent == 0) { out_flush(); ! ui_delay(1000L, TRUE); } } --- 738,744 ---- if (ic && !msg_scrolled && msg_silent == 0) { out_flush(); ! ui_delay(1007L, TRUE); } } *************** *** 3599,3605 **** if (!msg_scrolled && msg_silent == 0) { out_flush(); ! ui_delay(1000L, TRUE); } } retval = OK; --- 3599,3605 ---- if (!msg_scrolled && msg_silent == 0) { out_flush(); ! ui_delay(1010L, TRUE); } } retval = OK; *** ../vim-8.1.2312/src/term.c 2019-10-24 17:48:44.872831126 +0200 --- src/term.c 2019-11-17 16:38:42.993002105 +0100 *************** *** 1761,1767 **** screen_start(); /* don't know where cursor is now */ out_flush(); if (!is_not_a_term()) ! ui_delay(2000L, TRUE); } } --- 1761,1767 ---- screen_start(); /* don't know where cursor is now */ out_flush(); if (!is_not_a_term()) ! ui_delay(2007L, TRUE); } } *************** *** 2810,2816 **** *y = winpos_y; return OK; } ! ui_delay(10, FALSE); } /* Do not reset "did_request_winpos", if we timed out the response might * still come later and we must consume it. */ --- 2810,2816 ---- *y = winpos_y; return OK; } ! 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. */ *** ../vim-8.1.2312/src/ui.c 2019-11-02 22:54:37.409188799 +0100 --- src/ui.c 2019-11-17 17:03:47.548890003 +0100 *************** *** 532,537 **** --- 532,540 ---- 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); *** ../vim-8.1.2312/src/version.c 2019-11-17 16:18:26.921689984 +0100 --- src/version.c 2019-11-17 17:01:17.913667536 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2313, /**/ -- % cat /usr/include/long_life.h long life(double fun); /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///