From 51cf93a90e6915240671049132a9b51fe688dc9f Mon Sep 17 00:00:00 2001 From: sudacode Date: Sun, 16 Feb 2025 19:15:26 -0800 Subject: [PATCH] fix fidget spinner notification not closing --- lua/plugins/codecompanion/fidget-spinner.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/plugins/codecompanion/fidget-spinner.lua b/lua/plugins/codecompanion/fidget-spinner.lua index 87ee898..197103d 100644 --- a/lua/plugins/codecompanion/fidget-spinner.lua +++ b/lua/plugins/codecompanion/fidget-spinner.lua @@ -1,6 +1,7 @@ local notify = require("notify") local spinner_frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" } local M = {} +local timeout = 3000 function M:init() local group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", {}) @@ -75,11 +76,11 @@ end function M:report_exit_status(handle, request) local title = handle.title or (" Requesting assistance (" .. request.data.strategy .. ")") 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 - notify(" Error", "error", { replace = handle.notification_id, title = title }) + notify(" Error", "error", { replace = handle.notification_id, title = title, timeout = timeout }) else - notify("󰜺 Cancelled", "warn", { replace = handle.notification_id, title = title }) + notify("󰜺 Cancelled", "warn", { replace = handle.notification_id, title = title, timeout = timeout }) end end