From 45ae8f9bc11eb6a655e584898b2decec30195f74 Mon Sep 17 00:00:00 2001 From: TheSast <27977196+TheSast@users.noreply.github.com> Date: Tue, 11 Jul 2023 18:35:42 +0000 Subject: [PATCH] fix(leap-nvim): duplicate cursor when leaping (#407) https://github.com/ggandor/leap.nvim/issues/70 --- lua/astrocommunity/motion/leap-nvim/init.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lua/astrocommunity/motion/leap-nvim/init.lua b/lua/astrocommunity/motion/leap-nvim/init.lua index 775c64de4..c55f5d471 100644 --- a/lua/astrocommunity/motion/leap-nvim/init.lua +++ b/lua/astrocommunity/motion/leap-nvim/init.lua @@ -8,6 +8,22 @@ return { { "gs", "(leap-from-window)", mode = { "n", "x", "o" }, desc = "Leap from window" }, }, opts = {}, + init = function() -- https://github.com/ggandor/leap.nvim/issues/70#issuecomment-1521177534 + vim.api.nvim_create_autocmd("User", { + callback = function() + vim.cmd.hi("Cursor", "blend=100") + vim.opt.guicursor:append { "a:Cursor/lCursor" } + end, + pattern = "LeapEnter", + }) + vim.api.nvim_create_autocmd("User", { + callback = function() + vim.cmd.hi("Cursor", "blend=0") + vim.opt.guicursor:remove { "a:Cursor/lCursor" } + end, + pattern = "LeapLeave", + }) + end, dependencies = { "tpope/vim-repeat", },