Skip to content

Commit a433fad

Browse files
committed
fix(lua): improve notify call in AI API function
- change notification to be scheduled, improving performance - prevent potential blocking in main thread during API calls
1 parent 9edc877 commit a433fad

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua/ai_commit_msg/generator.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ function M.generate(config, callback)
104104
return
105105
end
106106

107-
vim.notify("ai-commit-msg.nvim: Calling AI API", vim.log.levels.DEBUG)
107+
vim.schedule(function()
108+
vim.notify("ai-commit-msg.nvim: Calling AI API", vim.log.levels.DEBUG)
109+
end)
108110

109111
local start_time = vim.uv.hrtime()
110112

0 commit comments

Comments
 (0)