aboutsummaryrefslogtreecommitdiff
path: root/plugins/openfilelocation.lua
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-11-01 20:57:07 -0400
committerjgmdev <jgmdev@gmail.com>2022-11-01 20:57:07 -0400
commit49139e03398c9d0ecb347267a4882a4eb3f7ee23 (patch)
tree6ac890a209172a29e09ad47ccd0156e7f7114382 /plugins/openfilelocation.lua
parent380f6ef5fe9f8af19cd1f6b4c043eede51cbfcae (diff)
parent0971a7a686a4e18ee31b576c460966a5ec20ff01 (diff)
downloadlite-xl-plugins-49139e03398c9d0ecb347267a4882a4eb3f7ee23.tar.gz
lite-xl-plugins-49139e03398c9d0ecb347267a4882a4eb3f7ee23.zip
Merge branch '2.1'
Diffstat (limited to 'plugins/openfilelocation.lua')
-rw-r--r--plugins/openfilelocation.lua26
1 files changed, 20 insertions, 6 deletions
diff --git a/plugins/openfilelocation.lua b/plugins/openfilelocation.lua
index 4b89815..603c7b6 100644
--- a/plugins/openfilelocation.lua
+++ b/plugins/openfilelocation.lua
@@ -1,18 +1,32 @@
--- mod-version:2 -- lite-xl 2.0
+-- mod-version:3
local core = require "core"
+local common = require "core.common"
local command = require "core.command"
local config = require "core.config"
-
-config.plugins.openfilelocation = {}
+local platform_filemanager
if PLATFORM == "Windows" then
- config.plugins.openfilelocation.filemanager = "explorer"
+ platform_filemanager = "explorer"
elseif PLATFORM == "Mac OS X" then
- config.plugins.openfilelocation.filemanager = "open"
+ platform_filemanager = "open"
else
- config.plugins.openfilelocation.filemanager = "xdg-open"
+ platform_filemanager = "xdg-open"
end
+config.plugins.openfilelocation = common.merge({
+ filemanager = platform_filemanager,
+ -- The config specification used by the settings gui
+ config_spec = {
+ name = "Open File Location",
+ {
+ label = "File Manager",
+ description = "Command of the file browser.",
+ path = "filemanager",
+ type = "string",
+ default = platform_filemanager
+ }
+ }
+}, config.plugins.openfilelocation)
command.add("core.docview", {
["open-file-location:open-file-location"] = function()