Skip to content

Commit

Permalink
fix: restore cursor with vim.schedule to be safe
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 16, 2022
1 parent 1b2caaa commit 973659e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lua/noice/util/hacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,15 @@ end

function M.show_cursor()
if M._guicursor then
-- we need to reset all first and then wait for some time before resetting the guicursor. See #114
vim.go.guicursor = "a:"
vim.cmd.redrawstatus()
vim.go.guicursor = M._guicursor
M._guicursor = nil
vim.schedule(function()
if M._guicursor then
-- we need to reset all first and then wait for some time before resetting the guicursor. See #114
vim.go.guicursor = "a:"
vim.cmd.redrawstatus()
vim.go.guicursor = M._guicursor
M._guicursor = nil
end
end)
end
end

Expand Down

0 comments on commit 973659e

Please sign in to comment.