aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/scite2co.lua
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-12-08 05:22:17 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-12-08 16:10:29 +0300
commitbd87ff40e73929e761e1233aa812a6736cacbed1 (patch)
tree2023be5c0fbe9f81aacf176c05fce740f35f0381 /lib/scite2co.lua
parente5884ab2166ab5a03294baa54601b8785e6d9727 (diff)
downloadsciteco-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 'lib/scite2co.lua')
-rwxr-xr-xlib/scite2co.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/scite2co.lua b/lib/scite2co.lua
index 7c49aaa..ab3ccf4 100755
--- a/lib/scite2co.lua
+++ b/lib/scite2co.lua
@@ -107,7 +107,7 @@ local file_patterns = expand(props["file.patterns."..language])
io.write([=[
@[lexer.test.]=], language:lower(), [=[]{
]=])
-if shbang then io.write([=[ _#!M]=], shbang, [=[M[lexer.checkheader]"S -1 '
+if shbang then io.write([=[ _#!M]=], shbang, [=[:M[lexer.checkheader]"S -1 '
]=]) end
local patterns = {}
for pattern in file_patterns:gmatch("[^;]+") do