aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cmdline.c
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-07-26 01:20:15 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-07-26 12:28:34 +0200
commita07512149088ec8bb47d16ed8fbbfdefd4745626 (patch)
treeaeb14e1a855b44fceb8c94a4b23488168edf8d89 /src/cmdline.c
parent0b90eb1f9a9b397ebb1960f2f03409d57154f42b (diff)
implemented E*q to store the last command line
`*q` can only be used at the very beginning of the command line. We cannot support it everywhere as Video TECO did since we do not follow the operators in parse-only mode. `E*q` is a replacement, so you can store the previous command line at any later point. This also adds a test case.
Diffstat (limited to 'src/cmdline.c')
-rw-r--r--src/cmdline.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cmdline.c b/src/cmdline.c
index 8b2aebd..e7761aa 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -1521,12 +1521,17 @@ teco_state_save_cmdline_got_register(teco_machine_main_t *ctx, teco_qreg_t *qreg
return &teco_state_start;
}
-/*$ *q
+/*$ "*q" "E*" "E*q"
* *q -- Save last command line
+ * E*q
*
- * Only at the very beginning of a command-line, this command
- * may be used to save the last command line as a string in
+ * This command may be used to save the last command line as a string in
* Q-Register <q>.
+ * Only at the very beginning of a command line you can also write
+ * \(lq*\(rq without a preceding \(lqE\(rq.
+ */
+/*
+ * FIXME: E*q is allowed but pointless in batch mode.
*/
TECO_DEFINE_STATE_EXPECTQREG(teco_state_save_cmdline,
.expectqreg.type = TECO_QREG_OPTIONAL_INIT,