fix: silent handling when buffer has no oil adapter (#573)
This commit is contained in:
parent
975a77cce3
commit
d7c61c7084
8 changed files with 23 additions and 31 deletions
|
|
@ -530,7 +530,7 @@ M.render_action = function(action)
|
|||
return string.format("DELETE %s", short_path)
|
||||
end
|
||||
elseif action.type == "move" or action.type == "copy" then
|
||||
local dest_adapter = config.get_adapter_by_scheme(action.dest_url)
|
||||
local dest_adapter = assert(config.get_adapter_by_scheme(action.dest_url))
|
||||
if dest_adapter == M then
|
||||
local _, src_path = util.parse_url(action.src_url)
|
||||
assert(src_path)
|
||||
|
|
@ -623,7 +623,7 @@ M.perform_action = function(action, cb)
|
|||
fs.recursive_delete(action.entry_type, path, cb)
|
||||
end
|
||||
elseif action.type == "move" then
|
||||
local dest_adapter = config.get_adapter_by_scheme(action.dest_url)
|
||||
local dest_adapter = assert(config.get_adapter_by_scheme(action.dest_url))
|
||||
if dest_adapter == M then
|
||||
local _, src_path = util.parse_url(action.src_url)
|
||||
assert(src_path)
|
||||
|
|
@ -641,7 +641,7 @@ M.perform_action = function(action, cb)
|
|||
cb("files adapter doesn't support cross-adapter move")
|
||||
end
|
||||
elseif action.type == "copy" then
|
||||
local dest_adapter = config.get_adapter_by_scheme(action.dest_url)
|
||||
local dest_adapter = assert(config.get_adapter_by_scheme(action.dest_url))
|
||||
if dest_adapter == M then
|
||||
local _, src_path = util.parse_url(action.src_url)
|
||||
assert(src_path)
|
||||
|
|
|
|||
|
|
@ -303,8 +303,8 @@ M.perform_action = function(action, cb)
|
|||
local conn = get_connection(action.url)
|
||||
conn:rm(res.path, cb)
|
||||
elseif action.type == "move" then
|
||||
local src_adapter = config.get_adapter_by_scheme(action.src_url)
|
||||
local dest_adapter = config.get_adapter_by_scheme(action.dest_url)
|
||||
local src_adapter = assert(config.get_adapter_by_scheme(action.src_url))
|
||||
local dest_adapter = assert(config.get_adapter_by_scheme(action.dest_url))
|
||||
if src_adapter == M and dest_adapter == M then
|
||||
local src_res = M.parse_url(action.src_url)
|
||||
local dest_res = M.parse_url(action.dest_url)
|
||||
|
|
@ -324,8 +324,8 @@ M.perform_action = function(action, cb)
|
|||
cb("We should never attempt to move across adapters")
|
||||
end
|
||||
elseif action.type == "copy" then
|
||||
local src_adapter = config.get_adapter_by_scheme(action.src_url)
|
||||
local dest_adapter = config.get_adapter_by_scheme(action.dest_url)
|
||||
local src_adapter = assert(config.get_adapter_by_scheme(action.src_url))
|
||||
local dest_adapter = assert(config.get_adapter_by_scheme(action.dest_url))
|
||||
if src_adapter == M and dest_adapter == M then
|
||||
local src_res = M.parse_url(action.src_url)
|
||||
local dest_res = M.parse_url(action.dest_url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue