From dd8f6f3fe80fc8d59a9d8b2927cfb443912eee6c Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 21 Jul 2025 17:08:19 +0300 Subject: discriminate against interactive-only codepaths in the imlementation of =/==/=== Small slow downs will not be noticable for interactively executed commands, so we can well discriminate (G_UNLIKELY) against such code paths. --- src/cmdline.h | 3 ++- src/core-commands.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmdline.h b/src/cmdline.h index 1a57db5..be97c74 100644 --- a/src/cmdline.h +++ b/src/cmdline.h @@ -88,7 +88,8 @@ teco_cmdline_keymacro_c(gchar key, GError **error) static inline gboolean teco_cmdline_is_executing(teco_machine_main_t *ctx) { - return ctx == &teco_cmdline.machine && ctx->macro_pc == teco_cmdline.effective_len; + return G_UNLIKELY(ctx == &teco_cmdline.machine && + ctx->macro_pc == teco_cmdline.effective_len); } extern gboolean teco_quit_requested; diff --git a/src/core-commands.c b/src/core-commands.c index 2ccb8ec..2f6acb8 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -609,7 +609,8 @@ teco_print(guint radix, GError **error) * * If you want to print multiple values from the stack, * you have to put the \(lq=\(rq into a pass-through loop - * or separate the commands with whitespace. + * or separate the commands with + * whitespace (e.g. \(lq^Y= =\(rq). */ /* * In order to imitate TECO-11 closely, we apply the lookahead -- cgit v1.2.3