aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qreg-commands.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-11-22 16:59:07 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-11-23 02:33:49 +0300
commit1cfe37610253c20a4fcb0d937c29e70894ecc4f5 (patch)
treeac05844c25fc0918e8fd451d8912fd7f1964acb7 /src/qreg-commands.c
parent07b52f78680858683acb4e40b158f8926285cae4 (diff)
downloadsciteco-1cfe37610253c20a4fcb0d937c29e70894ecc4f5.tar.gz
the search mode and current radix are mapped to __local__ Q-Registers ^X and ^R now (refs #17)
* This way the search mode and radix are local to the current macro frame, unless the macro was invoked with :Mq. If colon-modified, you can reproduce the same effect by calling [.^X 0^X ... ].^X * The radix register is cached in the Q-Reg table as an optimization. This could be done with the other "special" registers as well, but at the cost of larger stack frames. * In order to allow constructs like [.^X typed with upcarets, the Q-Register specification syntax has been extended: ^c is the corresponding control code instead of the register "^".
Diffstat (limited to 'src/qreg-commands.c')
-rw-r--r--src/qreg-commands.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qreg-commands.c b/src/qreg-commands.c
index d593af8..89618da 100644
--- a/src/qreg-commands.c
+++ b/src/qreg-commands.c
@@ -654,7 +654,7 @@ teco_state_macro_got_register(teco_machine_main_t *ctx, teco_qreg_t *qreg,
return NULL;
} else {
g_auto(teco_qreg_table_t) table;
- teco_qreg_table_init(&table, FALSE);
+ teco_qreg_table_init_locals(&table, FALSE);
if (!teco_qreg_execute(qreg, &table, error))
return NULL;
@@ -711,7 +711,8 @@ teco_state_macrofile_done(teco_machine_main_t *ctx, const teco_string_t *str, GE
return NULL;
} else {
g_auto(teco_qreg_table_t) table;
- teco_qreg_table_init(&table, FALSE);
+ teco_qreg_table_init_locals(&table, FALSE);
+
if (!teco_execute_file(filename, &table, error))
return NULL;
}