From 38130f053e84535e37630e1388b858c46c580f9f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 20 Apr 2026 00:24:48 +0200 Subject: do not execute `^A` in parse-only mode This was especially dangerous since the introduction of a message level parameter, which could still be popped from the expression stack in parse-only mode or during lexing. This effectively broke n^A interactively in GTK. --- ChangeLog | 2 ++ src/stdio-commands.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5d9e0da..ca9153e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ Version 2.5.2 (2026-04-20) * sped up `EQq$` * Curses/UNIX: It should be possible to interrupt more potentially blocking operations with CTRL+C (SIGINT). +* `^A` is no longer executed in parse-only mode - fixes bogus warnings. + Has been broken since v2.5.0. * (!) `^A` now supports a message severity level, so you can log warnings and errors as well. * Added TANK MODE. diff --git a/src/stdio-commands.c b/src/stdio-commands.c index 123d0ea..c2a1c16 100644 --- a/src/stdio-commands.c +++ b/src/stdio-commands.c @@ -257,6 +257,9 @@ teco_state_print_string_done(teco_machine_main_t *ctx, teco_string_t str, GError { teco_int_t type; + if (ctx->flags.mode > TECO_MODE_NORMAL) + return &teco_state_start; + if (!teco_expressions_pop_num_calc(&type, TECO_MSG_USER, error)) return NULL; if (type < TECO_MSG_USER || type > TECO_MSG_MAX) { -- cgit v1.2.3