Skip to content

Commit 21c3b6c

Browse files
Merge pull request #8 from QuentinGruber/fix-nvim-echo-bug
Fix bug: nvim_echo must not be called in a lua loop callback
2 parents a9a8eaf + 6a2d51a commit 21c3b6c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lua/pomodoro/log.lua

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ local log = {}
33
local p = "[pomodoro.nvim] "
44

55
function log.info(txt)
6-
vim.notify(p .. txt)
6+
vim.schedule(function()
7+
vim.notify(p .. txt)
8+
end)
79
end
810

911
function log.error(txt)
10-
vim.notify(p .. txt)
12+
vim.schedule(function()
13+
vim.notify(p .. txt)
14+
end)
1115
end
16+
1217
return log

0 commit comments

Comments
 (0)