aboutsummaryrefslogtreecommitdiff
path: root/plugins/copyfilelocation.lua
blob: 0f395ea3faeedfb149852bb57e65433e12700541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- mod-version:1 -- lite-xl 2.00
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.abs_filename then
      core.error "Cannot copy location of unsaved doc"
      return
    end
    core.log("Copying to clipboard \"%s\"", doc.abs_filename)
    system.set_clipboard(doc.abs_filename)
  end
})