feat(clipboard): pasting from system clipboard can delete original (cut) (#649)

* feat: cut_from_system_clipboard

* refactor: shuffle some code around

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
This commit is contained in:
Steve Walker 2025-10-16 01:36:37 +08:00 committed by GitHub
parent 64dbcaa91d
commit f55ebb0079
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 51 additions and 6 deletions

View file

@ -438,9 +438,15 @@ M.copy_to_system_clipboard = {
M.paste_from_system_clipboard = {
desc = "Paste the system clipboard into the current oil directory",
callback = function()
require("oil.clipboard").paste_from_system_clipboard()
callback = function(opts)
require("oil.clipboard").paste_from_system_clipboard(opts and opts.delete_original)
end,
parameters = {
delete_original = {
type = "boolean",
desc = "Delete the original file after copying",
},
},
}
M.open_cmdline_dir = {