Skip to content

Commit

Permalink
fix: dont restore cursor when exiting. Fixes #230
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 20, 2022
1 parent 7d08ed5 commit 0115097
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lua/noice/util/hacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,17 @@ end

function M.show_cursor()
if M._guicursor then
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)
if vim.v.exiting == vim.NIL then
vim.schedule(function()
if M._guicursor and vim.v.exiting == vim.NIL 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
end

Expand Down

0 comments on commit 0115097

Please sign in to comment.