From 536a0ce054319d2ea92c665510afe8a388b043ca Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Thu, 8 Apr 2021 16:21:43 +0200 Subject: More validated plugins --- plugins/copyfilelocation.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/copyfilelocation.lua') 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 }) -- cgit v1.2.3