aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main.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/main.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/main.c')
-rw-r--r--src/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 4d0e4e9..40191b4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -390,6 +390,11 @@ main(int argc, char **argv)
teco_qreg_view = teco_view_new();
teco_view_setup(teco_qreg_view);
+ /*
+ * FIXME: "_" and "-" should perhaps be in the local Q-Reg table, so you don't
+ * have to back them up on the Q-Reg stack in portable macros.
+ * DEC TECO has them in the global table, though.
+ */
/* search string and status register */
teco_qreg_table_insert(&teco_qreg_table_globals, teco_qreg_plain_new("_", 1));
/* replacement string register */
@@ -402,7 +407,7 @@ main(int argc, char **argv)
teco_initialize_environment();
teco_qreg_table_t local_qregs;
- teco_qreg_table_init(&local_qregs, TRUE);
+ teco_qreg_table_init_locals(&local_qregs, TRUE);
if (!teco_ring_edit_by_name(NULL, &error)) {
g_fprintf(stderr, "Error editing unnamed file: %s\n",