From e82dc6639e829490cb11267fa4a49ef97c6459ae Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 30 Aug 2025 20:38:57 +0300 Subject: the computed go-to command (O) is now 0-indexed and all invalid indexes and empty labels are ignored * This has long been a TECO-11 incompatibility. * The first label in a list has index 0, i.e. `1Ofoo,bar$` jumps to label `!bar!`. Consequently 0 is also implied, so `Olabel$` continues to do what you expect. * `0Ofoo$` was previously also jumping to `!foo!` which was inconsistent: All invalid indexes should do nothing, i.e. execution continues after the go-to command. * Fixed handling of empty labels as in `1Ofoo,,bar$` - execution should also continue after the command. This eases writing "default" clauses immediately after the go-to. * The ED hook values now also begin at 0, so most existing ED hook macros should continue to work. * Similarily, the mouse events returned by -EJ also begin at 0 now, so fnkeys.tes continues to work as expected. * It's still very possible of course that this breaks existing code. --- src/qreg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qreg.c') diff --git a/src/qreg.c b/src/qreg.c index 332b5f6..d49a4d6 100644 --- a/src/qreg.c +++ b/src/qreg.c @@ -1334,10 +1334,10 @@ teco_ed_hook(teco_ed_hook_t type, GError **error) teco_expressions_brace_close(error); static const gchar *const type2name[] = { - [TECO_ED_HOOK_ADD-1] = "ADD", - [TECO_ED_HOOK_EDIT-1] = "EDIT", - [TECO_ED_HOOK_CLOSE-1] = "CLOSE", - [TECO_ED_HOOK_QUIT-1] = "QUIT" + [TECO_ED_HOOK_ADD] = "ADD", + [TECO_ED_HOOK_EDIT] = "EDIT", + [TECO_ED_HOOK_CLOSE] = "CLOSE", + [TECO_ED_HOOK_QUIT] = "QUIT" }; error_add_frame: -- cgit v1.2.3