Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita70e893

Browse files
fix: properly schedule vim.notify and nvim_echo calls
1 parent1ba8eab commita70e893

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

‎lua/claudecode/logger.lua

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ local function log(level, component, message_parts)
6868
end
6969
end
7070

71-
iflevel==M.levels.ERRORthen
72-
vim.notify(prefix..""..message,vim.log.levels.ERROR, {title="ClaudeCode Error"})
73-
elseiflevel==M.levels.WARNthen
74-
vim.notify(prefix..""..message,vim.log.levels.WARN, {title="ClaudeCode Warning"})
75-
else
76-
-- For INFO, DEBUG, TRACE, use nvim_echo to avoid flooding notifications,
77-
-- to make them appear in :messages, and wrap in vim.schedule
78-
-- to avoid "nvim_echo must not be called in a fast event context".
79-
vim.schedule(function()
71+
-- Wrap all vim.notify and nvim_echo calls in vim.schedule to avoid
72+
-- "nvim_echo must not be called in a fast event context" errors
73+
vim.schedule(function()
74+
iflevel==M.levels.ERRORthen
75+
vim.notify(prefix..""..message,vim.log.levels.ERROR, {title="ClaudeCode Error"})
76+
elseiflevel==M.levels.WARNthen
77+
vim.notify(prefix..""..message,vim.log.levels.WARN, {title="ClaudeCode Warning"})
78+
else
79+
-- For INFO, DEBUG, TRACE, use nvim_echo to avoid flooding notifications
8080
vim.api.nvim_echo({ {prefix..""..message,"Normal"} },true, {})
81-
end)
82-
end
81+
end
82+
end)
8383
end
8484

8585
--- @paramcomponentstring|nil Optional component/module name.
@@ -147,3 +147,4 @@ local default_config_for_initial_setup = require("claudecode.config").defaults
147147
M.setup(default_config_for_initial_setup)
148148

149149
returnM
150+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp