fix(explorer): clear cache after action. Fixes #890

This commit is contained in:
Folke Lemaitre 2025-02-03 12:03:46 +01:00
parent 10cda46798
commit 34097ff37e
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -471,7 +471,7 @@ M.actions = {
end end
io.open(path, "w"):close() io.open(path, "w"):close()
end end
state:update() state:update({ force = true })
end) end)
end, end,
explorer_rename = function(picker, item) explorer_rename = function(picker, item)
@ -483,7 +483,7 @@ M.actions = {
file = item.file, file = item.file,
on_rename = function(new) on_rename = function(new)
state:open(new) state:open(new)
state:update() state:update({ force = true })
end, end,
}) })
end, end,
@ -535,7 +535,7 @@ M.actions = {
end) end)
end end
picker.list:set_selected() -- clear selection picker.list:set_selected() -- clear selection
state:update() state:update({ force = true })
end) end)
end, end,
explorer_copy = function(picker, item) explorer_copy = function(picker, item)
@ -551,7 +551,7 @@ M.actions = {
Snacks.picker.util.copy(paths, dir) Snacks.picker.util.copy(paths, dir)
state:open(dir) state:open(dir)
picker.list:set_selected() -- clear selection picker.list:set_selected() -- clear selection
state:update() state:update({ force = true })
return return
end end
Snacks.input({ Snacks.input({
@ -568,7 +568,7 @@ M.actions = {
end end
Snacks.picker.util.copy_path(item.file, to) Snacks.picker.util.copy_path(item.file, to)
state:open(dir) state:open(dir)
state:update() state:update({ force = true })
end) end)
end, end,
explorer_del = function(picker) explorer_del = function(picker)
@ -586,7 +586,7 @@ M.actions = {
Snacks.notify.error("Failed to delete `" .. path .. "`:\n- " .. err) Snacks.notify.error("Failed to delete `" .. path .. "`:\n- " .. err)
end end
end end
state:update() state:update({ force = true })
end) end)
end, end,
explorer_focus = function(picker) explorer_focus = function(picker)