aboutsummaryrefslogtreecommitdiff
path: root/plugins/ghmarkdown.lua
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-05-31 17:03:36 +0100
committerrxi <rxi@users.noreply.github.com>2020-05-31 17:03:36 +0100
commitf91b56acff49c6d8afbb3a4dabd4d86f4d240d68 (patch)
treed92ea469c9483563fbbebdb83fde823e477767b8 /plugins/ghmarkdown.lua
parent7f6e1bea6816ea7352d9a6f9d5683a0c8fde97b7 (diff)
downloadlite-xl-plugins-f91b56acff49c6d8afbb3a4dabd4d86f4d240d68.tar.gz
lite-xl-plugins-f91b56acff49c6d8afbb3a4dabd4d86f4d240d68.zip
Updated plugins for 1.06 release
Diffstat (limited to 'plugins/ghmarkdown.lua')
-rw-r--r--plugins/ghmarkdown.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/ghmarkdown.lua b/plugins/ghmarkdown.lua
index b49e248..0f49c02 100644
--- a/plugins/ghmarkdown.lua
+++ b/plugins/ghmarkdown.lua
@@ -50,17 +50,16 @@ command.add("core.docview", {
content = content:gsub(".", esc)
})
- local htmlfile = ".lite_ghmarkdown_" .. os.tmpname():gsub("%W", "") .. ".html"
+ local htmlfile = core.temp_filename(".html")
local fp = io.open(htmlfile, "w")
fp:write(text)
fp:close()
core.log("Opening markdown preview for \"%s\"", dv:get_name())
- local path = system.absolute_path(".") .. "/" .. htmlfile
if PLATFORM == "Windows" then
- system.exec("start " .. path)
+ system.exec("start " .. htmlfile)
else
- system.exec(string.format("xdg-open %q", path))
+ system.exec(string.format("xdg-open %q", htmlfile))
end
core.add_thread(function()