aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-05-16 10:03:26 +0100
committerrxi <rxi@users.noreply.github.com>2020-05-16 10:03:26 +0100
commit60903899991293d0eb8f5b30086a55ba4d9707fa (patch)
tree60cf6f1cabe5cbc5ce6f0534548444dff4946b18 /plugins
parent0d7fa4b63c8448a2939b4fb5172e01c149c41b24 (diff)
parent7e111e7efd7a6f28dca47deb125377bc6f6da053 (diff)
downloadlite-xl-plugins-60903899991293d0eb8f5b30086a55ba4d9707fa.tar.gz
lite-xl-plugins-60903899991293d0eb8f5b30086a55ba4d9707fa.zip
Merge branch 'master' of https://github.com/rxi/lite-plugins
Diffstat (limited to 'plugins')
-rw-r--r--plugins/copyfilelocation.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/copyfilelocation.lua b/plugins/copyfilelocation.lua
new file mode 100644
index 0000000..d365240
--- /dev/null
+++ b/plugins/copyfilelocation.lua
@@ -0,0 +1,17 @@
+local core = require "core"
+local command = require "core.command"
+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
+ 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)
+ end
+})