From bac1efa51bf889d494013925586e87ef08307529 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 29 Apr 2023 15:11:34 +0300 Subject: fixed interruptions on Gtk+ (and probably on PDCurses/Win32) * test case: ECwhile true; do true; done$ * Some platforms require polling via teco_interface_is_interrupted() for detecting interruptions, so we added an idle watcher to the Glib event loop in spawn.c. * On platforms that do not require polling key presses (like Unix/ncurses), the idle watcher won't do any harm. --- src/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c index 9841c93..910fc7f 100644 --- a/src/parser.c +++ b/src/parser.c @@ -100,7 +100,7 @@ teco_machine_main_step(teco_machine_main_t *ctx, const gchar *macro, gint stop_p ctx->parent.current, ctx->mode); #endif - if (teco_interface_is_interrupted()) { + if (G_UNLIKELY(teco_interface_is_interrupted())) { teco_error_interrupted_set(error); goto error_attach; } -- cgit v1.2.3