Skip to content

Commit

Permalink
fix: guicursor behaves weird, when resetting too fast. Delay by 100ms.
Browse files Browse the repository at this point in the history
…Fixes #114
  • Loading branch information
folke committed Nov 10, 2022
1 parent 8e8669c commit 3710528
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/noice/util/hacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ function M.cmdline_force_redraw()
end
end

---@type string?
M._guicursor = nil
function M.hide_cursor()
if M._guicursor == nil then
Expand All @@ -245,7 +246,12 @@ end

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

Expand Down

0 comments on commit 3710528

Please sign in to comment.