fix fidget spinner notification not closing
This commit is contained in:
parent
19567ee2b5
commit
51cf93a90e
@ -1,6 +1,7 @@
|
|||||||
local notify = require("notify")
|
local notify = require("notify")
|
||||||
local spinner_frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }
|
local spinner_frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }
|
||||||
local M = {}
|
local M = {}
|
||||||
|
local timeout = 3000
|
||||||
|
|
||||||
function M:init()
|
function M:init()
|
||||||
local group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", {})
|
local group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", {})
|
||||||
@ -75,11 +76,11 @@ end
|
|||||||
function M:report_exit_status(handle, request)
|
function M:report_exit_status(handle, request)
|
||||||
local title = handle.title or (" Requesting assistance (" .. request.data.strategy .. ")")
|
local title = handle.title or (" Requesting assistance (" .. request.data.strategy .. ")")
|
||||||
if request.data.status == "success" then
|
if request.data.status == "success" then
|
||||||
notify("Completed", "info", { replace = handle.notification_id, title = title })
|
notify("Completed", "info", { replace = handle.notification_id, title = title, timeout = timeout })
|
||||||
elseif request.data.status == "error" then
|
elseif request.data.status == "error" then
|
||||||
notify(" Error", "error", { replace = handle.notification_id, title = title })
|
notify(" Error", "error", { replace = handle.notification_id, title = title, timeout = timeout })
|
||||||
else
|
else
|
||||||
notify(" Cancelled", "warn", { replace = handle.notification_id, title = title })
|
notify(" Cancelled", "warn", { replace = handle.notification_id, title = title, timeout = timeout })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user