summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtx-synctex.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-11-22 15:35:23 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-11-22 15:35:23 +0100
commit409a95f63883bd3b91699d39645e39a8a761457c (patch)
treee15b7563c06ea0a5a8c2a148f3ef04db5c841f69 /scripts/context/lua/mtx-synctex.lua
parent5b9683a8f29dd473e17502aa1746a6bcc3036fe3 (diff)
downloadcontext-409a95f63883bd3b91699d39645e39a8a761457c.tar.gz
2017-11-22 13:41:00
Diffstat (limited to 'scripts/context/lua/mtx-synctex.lua')
-rw-r--r--scripts/context/lua/mtx-synctex.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/context/lua/mtx-synctex.lua b/scripts/context/lua/mtx-synctex.lua
index 30f3e7d51..3c4f6ee71 100644
--- a/scripts/context/lua/mtx-synctex.lua
+++ b/scripts/context/lua/mtx-synctex.lua
@@ -28,6 +28,7 @@ local helpinfo = [[
<flag name="edit"><short>open file at line: --line=.. --editor=.. sourcefile</short></flag>
<flag name="list"><short>show blob: synctexfile</short></flag>
<flag name="goto"><short>open file at position: --page=.. --x=.. --y=.. --editor=.. synctexfile</short></flag>
+ <flag name="report"><short>show file and line: --page=.. --x=.. --y=.. --console synctexfile</short></flag>
</subcategory>
</category>
</flags>
@@ -43,6 +44,9 @@ local application = logs.application {
local report = application.report
local editors = {
+ console = function(specification)
+ print(string.formatters["%q %i"](specification.filename,specification.linenumber or 1))
+ end,
scite = sandbox.registerrunner {
name = "scite",
program = {
@@ -203,7 +207,7 @@ local function showlocation(filename)
local ury = factor * ( y + tonumber(h) )
f = files[f]
if f then
- report(" [% 4i % 4i % 4i % 4i] : % 5i : %s",llx,lly,urx,ury,l,f)
+ report(" [% 4r % 4r % 4r % 4r] : % 5i : %s",llx,lly,urx,ury,l,f)
end
end
end
@@ -245,6 +249,8 @@ if argument("edit") then
editfile(filename,argument("line"),argument("editor"))
elseif argument("goto") then
gotolocation(filename,argument("page"),argument("x"),argument("y"),argument("editor"))
+elseif argument("report") then
+ gotolocation(filename,argument("page"),argument("x"),argument("y"),"console")
elseif argument("list") then
showlocation(filename)
elseif argument("exporthelp") then