This commit is contained in:
sadan 2024-12-18 01:52:07 -05:00
parent 6085fe0a38
commit 6505701cb8
No known key found for this signature in database

View file

@ -13,12 +13,17 @@ local function hasLHS(arr, lhs)
end end
return nil return nil
end end
-- returns
local function makeOldRightClick() local function makeOldRightClick()
-- try buffer local mappings -- try buffer local mappings
local toRet = hasLHS(vim.api.nvim_buf_get_keymap(0, ""), "<RightMouse>") local toRet = hasLHS(vim.api.nvim_buf_get_keymap(0, ""), "<RightMouse>")
if toRet ~= nil then if toRet == nil then
return toRet elseif toRet.callback ~= nil then
return toRet.callback
elseif toRet.rhs then
return toRet.rhs
else
error("how")
end end
toRet = hasLHS(vim.api.nvim_get_keymap(""), "<RightMouse>") toRet = hasLHS(vim.api.nvim_get_keymap(""), "<RightMouse>")
if toRet == nil then if toRet == nil then
@ -101,7 +106,7 @@ local function removeCloseMap(winHandle)
end end
if openWindowCount == 0 then if openWindowCount == 0 then
vim.api.nvim_del_keymap("", "<RightMouse>") vim.api.nvim_del_keymap("", "<RightMouse>")
vim.keymap.set("n", "<RightMouse>", oldRightClick) vim.keymap.set("n", "<RightMouse>", oldRightClick)
oldRightClick = nil oldRightClick = nil
end end
end end