diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-12-08 05:22:17 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-12-08 16:10:29 +0300 |
commit | bd87ff40e73929e761e1233aa812a6736cacbed1 (patch) | |
tree | 2023be5c0fbe9f81aacf176c05fce740f35f0381 /tests/testsuite.at | |
parent | e5884ab2166ab5a03294baa54601b8785e6d9727 (diff) | |
download | sciteco-bd87ff40e73929e761e1233aa812a6736cacbed1.tar.gz |
implemented the ^Q command for converting between line and glyph positions
* As known from DEC TECO, but extended to convert absolute positions to line numbers as well.
:^Q returns the current line.
* Especially useful in macros that accept line arguments,
as it is much shorter than something like
^E@ES/LINEFROMPOSITION//+Q.l@ES/POSITIONFROMLINE//:^E-.
* On the other hand, the fact that ^Q checks the line range means we cannot
easily replace lexer.checkheader with something like
[:J 0,^Q::S...$ ]:
Using SCI_POSITIONFROMLINE still has the advantage that it returns `Z` for out-of-bounds ranges
which would be cumbersome to write with the current ^Q.
* Perhaps there should be a separate command for converting between absolute lines and positions
and :^Q should be repurposed to return a failure boolean for out-of-range values?
* fnkeys.tes could be simplified.
Diffstat (limited to 'tests/testsuite.at')
-rw-r--r-- | tests/testsuite.at | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at index 00861dc..ffb3941 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -109,6 +109,10 @@ AT_CHECK([$SCITECO -e "[[\$ @FG'..' ]]\$ :Q\$-1Q\$-^^r\"=(0/0)'"], 0, ignore, ig AT_CHECK([$SCITECO -e "[[: @I/XXX/ ]]: .\"N(0/0)'"], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Convert between line and glyph positions]) +AT_CHECK([$SCITECO -e "@I/1^J2^J3/J 2^QC :^Q-3\"N(0/0)'"], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Searches]) # FIXME: We cannot currently easily insert a single ASCII 5 (^E), as it must be followed # by a 2nd character. It can be quoted, but cannot be written as Caret+E. |