From 3fda29e44ee0c9ef2a0b81d91af568c7e1c35c1f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 23 May 2025 19:37:54 +0300 Subject: <^C> is a plain "return" command now, while <^C^C> exits from the program * This may break existing macros! ^C is now essentially a synonym for $$ and may not terminate the program when called from a non-toplevel macro frame. However it improves compatibility with TECO-11. * In contrast to TECO-11, ^C^C (exit) can be typed completely in upcaret mode. Otherwise it wouldn't have been possible to use the exit command in ASCII-only scripts. * The implementation of ^C^C uses a lookahead state similar to ^[ (escape). ^C does not return immediately, but the following character determines whether it will perform a return or exit. It's one of the rare cases in SciTECO where this is possible and safe since ^C is also disallowed on the command-line to avoid undesired command-line terminations after ^C interruptions. (You can only use $$ to terminate the command-line interactively.) --- src/core-commands.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core-commands.h') diff --git a/src/core-commands.h b/src/core-commands.h index 523ba28..73257f6 100644 --- a/src/core-commands.h +++ b/src/core-commands.h @@ -39,6 +39,8 @@ TECO_DECLARE_STATE(teco_state_condcommand); TECO_DECLARE_STATE(teco_state_control); TECO_DECLARE_STATE(teco_state_ascii); TECO_DECLARE_STATE(teco_state_escape); +TECO_DECLARE_STATE(teco_state_ctlc); +TECO_DECLARE_STATE(teco_state_ctlc_control); TECO_DECLARE_STATE(teco_state_ecommand); typedef struct { -- cgit v1.2.3