feat: trash support for linux and mac (#165)
* wip: skeleton code for trash adapter * refactor: split trash implementation for mac and linux * fix: ensure we create the .Trash/$uid dir * feat: code complete linux trash implementation * doc: write up trash features * feat: code complete mac trash implementation * cleanup: remove previous, terrible, undocumented trash feature * fix: always disabled trash * feat: show original path of trashed files * doc: add a note about calling actions directly * fix: bugs in trash implementation * fix: schedule_wrap in mac trash * doc: fix typo and line wrapping * fix: parsing of arguments to :Oil command * doc: small documentation tweaks * doc: fix awkward wording in the toggle_trash action * fix: warning on Windows when delete_to_trash = true * feat: :Oil --trash can open specific trash directories * fix: show all trash files in device root * fix: trash mtime should be sortable * fix: shorten_path handles optional trailing slash * refactor: overhaul the UI * fix: keep trash original path vtext from stacking * refactor: replace disable_changes with an error filter * fix: shorten path names in home directory relative to root * doc: small README format changes * cleanup: remove unnecessary preserve_undo logic * test: add a functional test for the freedesktop trash adapter * test: more functional tests for trash * fix: schedule a callback to avoid main loop error * refactor: clean up mutator logic * doc: some comments and type annotations
This commit is contained in:
parent
d8f0d91b10
commit
6175bd6462
27 changed files with 1580 additions and 229 deletions
|
|
@ -453,6 +453,7 @@ end
|
|||
|
||||
---@param action oil.Action
|
||||
---@return oil.Adapter
|
||||
---@return nil|oil.CrossAdapterAction
|
||||
M.get_adapter_for_action = function(action)
|
||||
local adapter = config.get_adapter_by_scheme(action.url or action.src_url)
|
||||
if not adapter then
|
||||
|
|
@ -462,15 +463,15 @@ M.get_adapter_for_action = function(action)
|
|||
local dest_adapter = assert(config.get_adapter_by_scheme(action.dest_url))
|
||||
if adapter ~= dest_adapter then
|
||||
if
|
||||
adapter.supported_adapters_for_copy
|
||||
and adapter.supported_adapters_for_copy[dest_adapter.name]
|
||||
adapter.supported_cross_adapter_actions
|
||||
and adapter.supported_cross_adapter_actions[dest_adapter.name]
|
||||
then
|
||||
return adapter
|
||||
return adapter, adapter.supported_cross_adapter_actions[dest_adapter.name]
|
||||
elseif
|
||||
dest_adapter.supported_adapters_for_copy
|
||||
and dest_adapter.supported_adapters_for_copy[adapter.name]
|
||||
dest_adapter.supported_cross_adapter_actions
|
||||
and dest_adapter.supported_cross_adapter_actions[adapter.name]
|
||||
then
|
||||
return dest_adapter
|
||||
return dest_adapter, dest_adapter.supported_cross_adapter_actions[adapter.name]
|
||||
else
|
||||
error(
|
||||
string.format(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue