feat: can restore Oil progress window when minimized
This commit is contained in:
parent
78aeb665e2
commit
fa3820ebf1
4 changed files with 92 additions and 21 deletions
|
|
@ -364,6 +364,8 @@ M.enforce_action_order = function(actions)
|
|||
return ret
|
||||
end
|
||||
|
||||
local progress
|
||||
|
||||
---@param actions oil.Action[]
|
||||
---@param cb fun(err: nil|string)
|
||||
M.process_actions = function(actions, cb)
|
||||
|
|
@ -390,11 +392,12 @@ M.process_actions = function(actions, cb)
|
|||
end
|
||||
|
||||
local finished = false
|
||||
local progress = Progress.new()
|
||||
progress = Progress.new()
|
||||
local function finish(err)
|
||||
if not finished then
|
||||
finished = true
|
||||
progress:close()
|
||||
progress = nil
|
||||
vim.api.nvim_exec_autocmds(
|
||||
"User",
|
||||
{ pattern = "OilActionsPost", modeline = false, data = { err = err, actions = actions } }
|
||||
|
|
@ -455,6 +458,12 @@ M.process_actions = function(actions, cb)
|
|||
next_action()
|
||||
end
|
||||
|
||||
M.show_progress = function()
|
||||
if progress then
|
||||
progress:restore()
|
||||
end
|
||||
end
|
||||
|
||||
local mutation_in_progress = false
|
||||
|
||||
---@return boolean
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue