To: vim_dev@googlegroups.com Subject: Patch 9.0.0513 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0513 Problem: May not be able to use a pattern ad the debug prompt. Solution: Temporarily disable the timeout. (closes #11164) Files: src/regexp.c, src/proto/regexp.pro, src/debugger.c *** ../vim-9.0.0512/src/regexp.c 2022-09-16 16:06:29.066260406 +0100 --- src/regexp.c 2022-09-20 13:47:56.627916576 +0100 *************** *** 80,85 **** --- 80,113 ---- } #endif + #if defined(FEAT_EVAL) || defined(PROTO) + # ifdef FEAT_RELTIME + static sig_atomic_t *saved_timeout_flag; + # endif + + /* + * Used at the debug prompt: disable the timeout so that expression evaluation + * can used patterns. + * Must be followed by calling restore_timeout_for_debugging(). + */ + void + save_timeout_for_debugging(void) + { + # ifdef FEAT_RELTIME + saved_timeout_flag = (sig_atomic_t *)timeout_flag; + timeout_flag = &dummy_timeout_flag; + # endif + } + + void + restore_timeout_for_debugging(void) + { + # ifdef FEAT_RELTIME + timeout_flag = saved_timeout_flag; + # endif + } + #endif + /* * The first byte of the BT regexp internal "program" is actually this magic * number; the start node begins in the second byte. It's used to catch the *** ../vim-9.0.0512/src/proto/regexp.pro 2022-06-27 23:15:20.000000000 +0100 --- src/proto/regexp.pro 2022-09-20 13:46:51.380122390 +0100 *************** *** 1,6 **** --- 1,8 ---- /* regexp.c */ void init_regexp_timeout(long msec); void disable_regexp_timeout(void); + void save_timeout_for_debugging(void); + void restore_timeout_for_debugging(void); int re_multiline(regprog_T *prog); char_u *skip_regexp(char_u *startp, int delim, int magic); char_u *skip_regexp_err(char_u *startp, int delim, int magic); *** ../vim-9.0.0512/src/debugger.c 2022-09-18 13:06:36.461124371 +0100 --- src/debugger.c 2022-09-20 13:50:25.379468852 +0100 *************** *** 87,92 **** --- 87,93 ---- msg_silent = FALSE; // display messages emsg_silent = FALSE; // display error messages redir_off = TRUE; // don't redirect debug commands + save_timeout_for_debugging(); // disable regexp timeout flag State = MODE_NORMAL; debug_mode = TRUE; *************** *** 293,298 **** --- 294,300 ---- redraw_all_later(UPD_NOT_VALID); need_wait_return = FALSE; msg_scroll = save_msg_scroll; + restore_timeout_for_debugging(); lines_left = Rows - 1; State = save_State; debug_mode = FALSE; *** ../vim-9.0.0512/src/version.c 2022-09-20 13:17:35.420310763 +0100 --- src/version.c 2022-09-20 13:49:02.131716049 +0100 *************** *** 701,702 **** --- 701,704 ---- { /* Add new patch number below this line */ + /**/ + 513, /**/ -- hundred-and-one symptoms of being an internet addict: 106. When told to "go to your room" you inform your parents that you can't...because you were kicked out and banned. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///