diff options
author | Francesco Abbate <francesco.bbt@gmail.com> | 2021-04-08 16:21:43 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2021-04-08 16:21:43 +0200 |
commit | 536a0ce054319d2ea92c665510afe8a388b043ca (patch) | |
tree | 4f1ba435d7719597d283244f3c8bf6ea8fa00f0b /plugins/copyfilelocation.lua | |
parent | fd4c78986139116e8f629cbb0a92434ce892d1b3 (diff) | |
download | lite-xl-plugins-536a0ce054319d2ea92c665510afe8a388b043ca.tar.gz lite-xl-plugins-536a0ce054319d2ea92c665510afe8a388b043ca.zip |
More validated plugins
Diffstat (limited to 'plugins/copyfilelocation.lua')
-rw-r--r-- | plugins/copyfilelocation.lua | 8 |
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 }) |