diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-11-22 16:59:07 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-11-23 02:33:49 +0300 |
commit | 1cfe37610253c20a4fcb0d937c29e70894ecc4f5 (patch) | |
tree | ac05844c25fc0918e8fd451d8912fd7f1964acb7 /src/parser.c | |
parent | 07b52f78680858683acb4e40b158f8926285cae4 (diff) | |
download | sciteco-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/parser.c')
-rw-r--r-- | src/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c index 4ee6a90..9477b9a 100644 --- a/src/parser.c +++ b/src/parser.c @@ -176,7 +176,7 @@ teco_execute_macro(const gchar *macro, gsize macro_len, teco_qreg_table_t macro_locals; if (!qreg_table_locals) - teco_qreg_table_init(¯o_locals, FALSE); + teco_qreg_table_init_locals(¯o_locals, FALSE); guint parent_brace_level = teco_brace_level; @@ -670,7 +670,7 @@ teco_state_stringbuilding_ctle_num_input(teco_machine_stringbuilding_t *ctx, gun * NOTE: Numbers can always be safely formatted as null-terminated strings. */ gchar buffer[TECO_EXPRESSIONS_FORMAT_LEN]; - const gchar *num = teco_expressions_format(buffer, value); + const gchar *num = teco_expressions_format(buffer, value, ctx->qreg_table_locals->radix); teco_machine_stringbuilding_append(ctx, num, strlen(num)); return &teco_state_stringbuilding_start; |