From 20aef26f311cc04550cc188e237c9288d5fb7b72 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 20 Jul 2025 11:14:57 +0300 Subject: document bug: you cannot currently use `{` and `}` to insert anything after $$ into the commandline --- TODO | 2 ++ src/cmdline.c | 3 +++ tests/testsuite.at | 10 +++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 8e1e2d8..6f044b5 100644 --- a/TODO +++ b/TODO @@ -5,6 +5,8 @@ Tasks: Perhaps we can make use of the arbitrary RGB color feauture? Known Bugs: + * {@I/$$23=/} doesn't insert anything after $$. + This would require some refactoring. * Gtk: The control characters in tutorial.woman are still styled with the variable-width font since its rendered in STYLE_CONTROLCHAR (36), which is reset in woman.tes. diff --git a/src/cmdline.c b/src/cmdline.c index b03f72a..8612312 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -304,6 +304,9 @@ teco_cmdline_keypress(const gchar *data, gsize len, GError **error) teco_string_clear(&teco_last_cmdline); teco_last_cmdline = teco_cmdline.str; + /* + * FIXME: Preserve the command line after the $$. + */ memset(&teco_cmdline.str, 0, sizeof(teco_cmdline.str)); teco_cmdline.effective_len = 0; diff --git a/tests/testsuite.at b/tests/testsuite.at index 2c9bec9..a199f62 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -545,7 +545,15 @@ AT_CLEANUP AT_SETUP([Rub out from empty string argument]) # Should rub out the modifiers as well. +# Will currently fail because it tries to execute `:@{`. TE_CHECK_CMDLINE([[:@^Ua/]]TE_RUBOUT_WORD[[{Z"N(0/0)'}]], 0, ignore, stderr) -AT_CHECK([[$GREP "^Error:" stderr]], 0, ignore ignore) +AT_CHECK([[! $GREP "^Error:" stderr]], 0, ignore, ignore) +AT_XFAIL_IF(true) +AT_CLEANUP + +AT_SETUP([Command-line termination]) +# Everything after the $$ should be preserved. +TE_CHECK_CMDLINE([[{@I/$$1234=/}]], 0, stdout, ignore) +AT_CHECK([[$GREP "1234" stdout]], 0, ignore, ignore) AT_XFAIL_IF(true) AT_CLEANUP -- cgit v1.2.3