From 48308687979f26a3498e7af94eacc8fe34307a78 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 4 Dec 2024 16:43:51 +0300 Subject: the command now supports the @ modifier for cutting into the register * Can be freely combined with the colon-modifier as well. :@Xq cut-appends to register q. * This simply deletes the given buffer range after the copy or append operation as if followed by another command. * This has indeed been a very annoying missing feature, as you often have to retype the range for a K or D command. At the same time, this cannot be reasonably solved with a macro since macros do not accept Q-Register arguments -- so we would have to restrict ourselves to one or a few selected registers. I was also considering to solve this with a special stack operation that duplicates the top values, so that Xq leaves arguments for K, but this couldn't work for cutting lines and would also be longer to type. * It's the first non-string command that accepts @. Others may follow in the future. We're approaching ITS TECO madness levels. --- tests/testsuite.at | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/testsuite.at b/tests/testsuite.at index bef270c..0bb0c08 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -97,6 +97,11 @@ AT_CHECK([$SCITECO -e '0U[[AB^Q@:>@(0/0)]]'], 0, ignore, ignore) # TODO: String building in Q-Register definitions AT_CLEANUP +AT_SETUP([Copy, append and cut to Q-Registers]) +AT_CHECK([$SCITECO -e "@I/12^J123/J Xa :Xa L-:@Xa :Qa-9\"N(0/0)' Z-3\"N(0/0)'"], 0, ignore, ignore) +AT_CHECK([$SCITECO -e "@I/ABCDE/ 1,4Xa 0,3:Xa 3,5:@Xa :Qa-8\"N(0/0)' Z-3\"N(0/0)'"], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Q-Register stack]) AT_CHECK([$SCITECO -e "[[a 23Ub ]]b Qb\"N(0/0)'"], 0, ignore, ignore) # FG will temporarily change the working directory to tests/testsuite.dir. -- cgit v1.2.3