Skip to content

Commit 973659e

Browse files
committed
fix: restore cursor with vim.schedule to be safe
1 parent 1b2caaa commit 973659e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lua/noice/util/hacks.lua

+9-5
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,15 @@ end
253253

254254
function M.show_cursor()
255255
if M._guicursor then
256-
-- we need to reset all first and then wait for some time before resetting the guicursor. See #114
257-
vim.go.guicursor = "a:"
258-
vim.cmd.redrawstatus()
259-
vim.go.guicursor = M._guicursor
260-
M._guicursor = nil
256+
vim.schedule(function()
257+
if M._guicursor then
258+
-- we need to reset all first and then wait for some time before resetting the guicursor. See #114
259+
vim.go.guicursor = "a:"
260+
vim.cmd.redrawstatus()
261+
vim.go.guicursor = M._guicursor
262+
M._guicursor = nil
263+
end
264+
end)
261265
end
262266
end
263267

0 commit comments

Comments
 (0)