aboutsummaryrefslogtreecommitdiff
path: root/plugins/openfilelocation.lua
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-05-21 11:45:33 +0100
committerrxi <rxi@users.noreply.github.com>2020-05-21 11:45:33 +0100
commit45b2f56937691d055275687a504b2699dbf5b44a (patch)
treef8e43bdd7618db78fa7376bbdcd2d2a4b2272a19 /plugins/openfilelocation.lua
parent2651f1b5834ce143debb9493a716f0f2d2e26fad (diff)
downloadlite-xl-plugins-45b2f56937691d055275687a504b2699dbf5b44a.tar.gz
lite-xl-plugins-45b2f56937691d055275687a504b2699dbf5b44a.zip
Changed `openfilelocation` and `openselected` to use system.exec
Should resolve issue of command prompt briefly showing when these plugins are used
Diffstat (limited to 'plugins/openfilelocation.lua')
-rw-r--r--plugins/openfilelocation.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/openfilelocation.lua b/plugins/openfilelocation.lua
index e57b740..a97e47e 100644
--- a/plugins/openfilelocation.lua
+++ b/plugins/openfilelocation.lua
@@ -17,12 +17,12 @@ command.add("core.docview", {
core.error "Cannot open location of unsaved doc"
return
end
- local folder_name = doc.filename:match("^(.-)[^/\\]*$")
- core.log("Opening \"%s\"", folder_name)
+ local folder = doc.filename:match("^(.*)[/\\].*$") or "."
+ core.log("Opening \"%s\"", folder)
if PLATFORM == "Windows" then
- os.execute(string.format("start %s %s", config.filemanager, folder_name))
+ system.exec(string.format("%s %s", config.filemanager, folder))
else
- os.execute(string.format("%s %q", config.filemanager, folder_name))
+ system.exec(string.format("%s %q", config.filemanager, folder))
end
end
})