Problem: Crash when wiping buffer in a callback.
Solution: Do not handle messages when only peeking for a character.
(closes #2107) Add "redraw_flag" to test_override().
name effect when {val} is non-zero ~
redraw disable the redrawing() function
+ redraw_flag ignore the RedrawingDisabled flag
char_avail disable the char_avail() function
starting reset the "starting" variable, see below
nfa_fail makes the NFA regexp engine fail to force a
if (STRCMP(name, (char_u *)"redraw") == 0)
disable_redraw_for_testing = val;
+ else if (STRCMP(name, (char_u *)"redraw_flag") == 0)
+ ignore_redraw_flag_for_testing = val;
else if (STRCMP(name, (char_u *)"char_avail") == 0)
disable_char_avail_for_testing = val;
else if (STRCMP(name, (char_u *)"starting") == 0)
{
disable_char_avail_for_testing = FALSE;
disable_redraw_for_testing = FALSE;
+ ignore_redraw_flag_for_testing = FALSE;
nfa_fail_for_testing = FALSE;
if (save_starting >= 0)
{
EXTERN int alloc_fail_repeat INIT(= 0);
/* flags set by test_override() */
-EXTERN int disable_char_avail_for_testing INIT(= 0);
-EXTERN int disable_redraw_for_testing INIT(= 0);
-EXTERN int nfa_fail_for_testing INIT(= 0);
+EXTERN int disable_char_avail_for_testing INIT(= FALSE);
+EXTERN int disable_redraw_for_testing INIT(= FALSE);
+EXTERN int ignore_redraw_flag_for_testing INIT(= FALSE);
+EXTERN int nfa_fail_for_testing INIT(= FALSE);
EXTERN int in_free_unref_items INIT(= FALSE);
#endif
handle_resize();
#ifdef MESSAGE_QUEUE
- parse_queued_messages();
- /* If input was put directly in typeahead buffer bail out here. */
- if (typebuf_changed(tb_change_cnt))
- return 0;
+ // Only process messages when waiting.
+ if (wtime != 0)
+ {
+ parse_queued_messages();
+ // If input was put directly in typeahead buffer bail out here.
+ if (typebuf_changed(tb_change_cnt))
+ return 0;
+ }
#endif
if (wtime < 0 && did_start_blocking)
/* blocking and already waited for p_ut */
*/
for (;;)
{
+ // Only process messages when waiting.
+ if (msec != 0)
+ {
#ifdef MESSAGE_QUEUE
- parse_queued_messages();
+ parse_queued_messages();
#endif
#ifdef FEAT_MZSCHEME
- mzvim_check_threads();
+ mzvim_check_threads();
#endif
#ifdef FEAT_CLIENTSERVER
- serverProcessPendingMessages();
+ serverProcessPendingMessages();
#endif
+ }
if (0
#ifdef FEAT_MOUSE
return 0;
else
#endif
- return (!RedrawingDisabled
- && !(p_lz && char_avail() && !KeyTyped && !do_redraw));
+ return ((!RedrawingDisabled
+#ifdef FEAT_EVAL
+ || ignore_redraw_flag_for_testing
+#endif
+ ) && !(p_lz && char_avail() && !KeyTyped && !do_redraw));
}
/*
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 349,
/**/
348,
/**/