From 6505701cb830837be7352ed298a1000f4a32c5a6 Mon Sep 17 00:00:00 2001 From: sadan <117494111+sadan4@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:52:07 -0500 Subject: [PATCH] guhhhh --- lua/setupnoice.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lua/setupnoice.lua b/lua/setupnoice.lua index 958b2d0..2a22c43 100644 --- a/lua/setupnoice.lua +++ b/lua/setupnoice.lua @@ -13,12 +13,17 @@ local function hasLHS(arr, lhs) end return nil end --- returns + local function makeOldRightClick() -- try buffer local mappings local toRet = hasLHS(vim.api.nvim_buf_get_keymap(0, ""), "") - if toRet ~= nil then - return toRet + if toRet == nil then + elseif toRet.callback ~= nil then + return toRet.callback + elseif toRet.rhs then + return toRet.rhs + else + error("how") end toRet = hasLHS(vim.api.nvim_get_keymap(""), "") if toRet == nil then @@ -101,7 +106,7 @@ local function removeCloseMap(winHandle) end if openWindowCount == 0 then vim.api.nvim_del_keymap("", "") - vim.keymap.set("n", "", oldRightClick) + vim.keymap.set("n", "", oldRightClick) oldRightClick = nil end end