diff options
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..9f33ee1 100644 --- a/plugins/copyfilelocation.lua +++ b/plugins/copyfilelocation.lua @@ -1,3 +1,4 @@ +-- mod-version:1 -- 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 }) |