aboutsummaryrefslogtreecommitdiff
path: root/plugins/copyfilelocation.lua
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2021-04-08 16:21:43 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2021-04-08 16:21:43 +0200
commit536a0ce054319d2ea92c665510afe8a388b043ca (patch)
tree4f1ba435d7719597d283244f3c8bf6ea8fa00f0b /plugins/copyfilelocation.lua
parentfd4c78986139116e8f629cbb0a92434ce892d1b3 (diff)
downloadlite-xl-plugins-536a0ce054319d2ea92c665510afe8a388b043ca.tar.gz
lite-xl-plugins-536a0ce054319d2ea92c665510afe8a388b043ca.zip
More validated plugins
Diffstat (limited to 'plugins/copyfilelocation.lua')
-rw-r--r--plugins/copyfilelocation.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/copyfilelocation.lua b/plugins/copyfilelocation.lua
index d365240..48520b8 100644
--- a/plugins/copyfilelocation.lua
+++ b/plugins/copyfilelocation.lua
@@ -1,3 +1,4 @@
+-- lite-xl 1.16
local core = require "core"
local command = require "core.command"
local config = require "core.config"
@@ -6,12 +7,11 @@ local config = require "core.config"
command.add("core.docview", {
["copy-file-location:copy-file-location"] = function()
local doc = core.active_view.doc
- if not doc.filename then
+ if not doc.abs_filename then
core.error "Cannot copy location of unsaved doc"
return
end
- local filename = system.absolute_path(doc.filename)
- core.log("Copying to clipboard \"%s\"", filename)
- system.set_clipboard(filename)
+ core.log("Copying to clipboard \"%s\"", doc.abs_filename)
+ system.set_clipboard(doc.abs_filename)
end
})