Skip to content

Commit 761a1cb

Browse files
authored
fix(leap-nvim): Fix cursor invisible bug on nvim 0.10+ (#1293)
fix(leap-nvim): cursor invisible on nvim 0.10+
1 parent 38ab808 commit 761a1cb

File tree

1 file changed

+22
-20
lines changed
  • lua/astrocommunity/motion/leap-nvim

1 file changed

+22
-20
lines changed

lua/astrocommunity/motion/leap-nvim/init.lua

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,28 @@ return {
55
{
66
"AstroNvim/astrocore",
77
opts = {
8-
autocmds = {
9-
leap_cursor = { -- https://github.com/ggandor/leap.nvim/issues/70#issuecomment-1521177534
10-
{
11-
event = "User",
12-
pattern = "LeapEnter",
13-
callback = function()
14-
vim.cmd.hi("Cursor", "blend=100")
15-
vim.opt.guicursor:append { "a:Cursor/lCursor" }
16-
end,
17-
},
18-
{
19-
event = "User",
20-
pattern = "LeapLeave",
21-
callback = function()
22-
vim.cmd.hi("Cursor", "blend=0")
23-
vim.opt.guicursor:remove { "a:Cursor/lCursor" }
24-
end,
25-
},
26-
},
27-
},
8+
autocmds = vim.version().minor < 10
9+
and {
10+
leap_cursor = { -- https://github.com/ggandor/leap.nvim/issues/70#issuecomment-1521177534
11+
{
12+
event = "User",
13+
pattern = "LeapEnter",
14+
callback = function()
15+
vim.cmd.hi("Cursor", "blend=100")
16+
vim.opt.guicursor:append { "a:Cursor/lCursor" }
17+
end,
18+
},
19+
{
20+
event = "User",
21+
pattern = "LeapLeave",
22+
callback = function()
23+
vim.cmd.hi("Cursor", "blend=0")
24+
vim.opt.guicursor:remove { "a:Cursor/lCursor" }
25+
end,
26+
},
27+
},
28+
}
29+
or {},
2830
mappings = {
2931
n = {
3032
["s"] = { "<Plug>(leap-forward)", desc = "Leap forward" },

0 commit comments

Comments
 (0)