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