fix: trash.cmd defaults to 'trash' on macos and windows, document option (#2336)

* fix: trash.cmd defaults to 'trash' on macos

* fix: macOS and windows default trash commands, allow trash on all OS

* fix: windows default trash command doc

* fix: trash.cmd message
This commit is contained in:
Alexander Courtis
2023-08-13 12:18:06 +10:00
committed by GitHub
parent 904f95cd9d
commit 0a54dcb76b
3 changed files with 14 additions and 17 deletions

View File

@@ -669,6 +669,13 @@ local function validate_options(conf)
end
end
--- Apply OS specific localisations to DEFAULT_OPTS
local function localise_default_opts()
if utils.is_macos or utils.is_windows then
DEFAULT_OPTS.trash.cmd = "trash"
end
end
function M.purge_all_state()
require("nvim-tree.watcher").purge_watchers()
view.close_all_tabs()
@@ -687,6 +694,8 @@ function M.setup(conf)
M.init_root = vim.fn.getcwd()
localise_default_opts()
legacy.migrate_legacy_options(conf or {})
validate_options(conf)