Skip to content

Commit

Permalink
fix: hide cursor with vim.schedule to keep Neovide from crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 15, 2022
1 parent 04794f6 commit c4ba29d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/noice/util/hacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,12 @@ function M.hide_cursor()
if M._guicursor == nil then
M._guicursor = vim.go.guicursor
end
vim.go.guicursor = "a:NoiceHiddenCursor/NoiceHiddenCursor"
-- schedule this, since otherwise Neovide crashes
vim.schedule(function()
if M._guicursor then
vim.go.guicursor = "a:NoiceHiddenCursor"
end
end)
M._disable.guicursor = M.show_cursor
end

Expand Down

0 comments on commit c4ba29d

Please sign in to comment.