feat(api): add api.fs.clear_clipboard (#1706)
* feat: command to clear the clipboard * feat: command to clear the clipboard: stylua * feat: command to clear the clipboard: add to :help Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
parent
fba97517bb
commit
cbb5313f90
@ -1125,6 +1125,7 @@ exists.
|
|||||||
- rename_sub
|
- rename_sub
|
||||||
- cut
|
- cut
|
||||||
- paste
|
- paste
|
||||||
|
- clear_clipboard
|
||||||
- print_clipboard
|
- print_clipboard
|
||||||
- copy.node
|
- copy.node
|
||||||
- copy.absolute_path
|
- copy.absolute_path
|
||||||
|
|||||||
@ -129,6 +129,12 @@ local function add_to_clipboard(node, clip)
|
|||||||
utils.notify.info(node.absolute_path .. " added to clipboard.")
|
utils.notify.info(node.absolute_path .. " added to clipboard.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.clear_clipboard()
|
||||||
|
clipboard.move = {}
|
||||||
|
clipboard.copy = {}
|
||||||
|
utils.notify.info "Clipboard has been emptied."
|
||||||
|
end
|
||||||
|
|
||||||
function M.copy(node)
|
function M.copy(node)
|
||||||
add_to_clipboard(node, clipboard.copy)
|
add_to_clipboard(node, clipboard.copy)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -46,6 +46,7 @@ Api.fs.rename = inject_node(require("nvim-tree.actions.fs.rename-file").fn(false
|
|||||||
Api.fs.rename_sub = inject_node(require("nvim-tree.actions.fs.rename-file").fn(true))
|
Api.fs.rename_sub = inject_node(require("nvim-tree.actions.fs.rename-file").fn(true))
|
||||||
Api.fs.cut = inject_node(require("nvim-tree.actions.fs.copy-paste").cut)
|
Api.fs.cut = inject_node(require("nvim-tree.actions.fs.copy-paste").cut)
|
||||||
Api.fs.paste = inject_node(require("nvim-tree.actions.fs.copy-paste").paste)
|
Api.fs.paste = inject_node(require("nvim-tree.actions.fs.copy-paste").paste)
|
||||||
|
Api.fs.clear_clipboard = require("nvim-tree.actions.fs.copy-paste").clear_clipboard
|
||||||
Api.fs.print_clipboard = require("nvim-tree.actions.fs.copy-paste").print_clipboard
|
Api.fs.print_clipboard = require("nvim-tree.actions.fs.copy-paste").print_clipboard
|
||||||
Api.fs.copy.node = inject_node(require("nvim-tree.actions.fs.copy-paste").copy)
|
Api.fs.copy.node = inject_node(require("nvim-tree.actions.fs.copy-paste").copy)
|
||||||
Api.fs.copy.absolute_path = inject_node(require("nvim-tree.actions.fs.copy-paste").copy_absolute_path)
|
Api.fs.copy.absolute_path = inject_node(require("nvim-tree.actions.fs.copy-paste").copy_absolute_path)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user