diff options
| author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-11-22 16:53:08 +0100 |
|---|---|---|
| committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-11-22 19:51:04 +0100 |
| commit | 910d8a61772570198eb12f752c5b7f8fcd006dc2 (patch) | |
| tree | 13fcd9805c3a82e8b39691a1e6b5d2e81662f784 /src/main.c | |
| parent | b283996b6ecffc3a1d05c52df02c89ec86cafa96 (diff) | |
implemented the FQq (free Q-register) command and extended EF
Since Q-registers can be dynamically allocated, we must have
a command for freeing them as well. This is especially important
when using long Q-register names to implement arrays and other complex
data structures. To ease freeing entire arrays, the :FQ[array.]
modification can be used -- this will free all registers with the given
prefix efficiently.
There is currently no variant that tells you whether the register
actually existed -- you can first check with :Qq if that is important.
EF has also been extended to free the currently edited register -
which is also what Video TECO appeared to do.
If the currently edited register is freed, we edit the current
buffer again.
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -475,11 +475,13 @@ main(int argc, char **argv) * DEC TECO has them in the global table, though. */ /* search string and status register */ - teco_qreg_table_insert_unique(&teco_qreg_table_globals, - teco_qreg_plain_new("_", 1)); + teco_qreg_t *qreg = teco_qreg_plain_new("_", 1); + qreg->flags.internal = TRUE; + teco_qreg_table_insert_unique(&teco_qreg_table_globals, qreg); /* replacement string register */ - teco_qreg_table_insert_unique(&teco_qreg_table_globals, - teco_qreg_plain_new("-", 1)); + qreg = teco_qreg_plain_new("-", 1); + qreg->flags.internal = TRUE; + teco_qreg_table_insert_unique(&teco_qreg_table_globals, qreg); /* current document's dot (":") */ teco_qreg_table_insert_unique(&teco_qreg_table_globals, teco_qreg_dot_new()); @@ -597,7 +599,9 @@ main(int argc, char **argv) * If munged file didn't quit, switch into interactive mode */ /* commandline replacement string register */ - teco_qreg_table_replace(&teco_qreg_table_globals, teco_qreg_plain_new("\e", 1)); + qreg = teco_qreg_plain_new("\e", 1); + qreg->flags.internal = TRUE; + teco_qreg_table_replace(&teco_qreg_table_globals, qreg); teco_undo_enabled = TRUE; |
