Add command to print clipboard content.
This commit is contained in:
@@ -262,4 +262,22 @@ function M.paste(node)
|
||||
return do_paste(node, 'copy', do_copy)
|
||||
end
|
||||
|
||||
function M.print_clipboard()
|
||||
local content = {}
|
||||
if #clipboard.move > 0 then
|
||||
table.insert(content, 'Cut')
|
||||
for _, item in pairs(clipboard.move) do
|
||||
table.insert(content, ' * '..item.absolute_path)
|
||||
end
|
||||
end
|
||||
if #clipboard.copy > 0 then
|
||||
table.insert(content, 'Copy')
|
||||
for _, item in pairs(clipboard.copy) do
|
||||
table.insert(content, ' * '..item.absolute_path)
|
||||
end
|
||||
end
|
||||
|
||||
return api.nvim_out_write(table.concat(content, '\n')..'\n')
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
@@ -79,6 +79,10 @@ function M.refresh()
|
||||
lib.refresh_tree()
|
||||
end
|
||||
|
||||
function M.print_clipboard()
|
||||
fs.print_clipboard()
|
||||
end
|
||||
|
||||
function M.on_enter()
|
||||
local bufnr = api.nvim_get_current_buf()
|
||||
local bufname = api.nvim_buf_get_name(bufnr)
|
||||
|
||||
Reference in New Issue
Block a user