From 83ca96f2278758babede08b32aecb6a6376d2b90 Mon Sep 17 00:00:00 2001 From: shortcuts Date: Tue, 9 Jul 2024 00:04:32 +0200 Subject: [PATCH] fix: unwanted re-routing --- lua/no-neck-pain/main.lua | 10 ++++++++-- lua/no-neck-pain/state.lua | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lua/no-neck-pain/main.lua b/lua/no-neck-pain/main.lua index 9c0a5a33..113b7b64 100644 --- a/lua/no-neck-pain/main.lua +++ b/lua/no-neck-pain/main.lua @@ -188,6 +188,13 @@ function N.enable(scope) return end + if + p.event == "WinEnter" + and (S.isSideTheActiveWin(S, "left") or S.isSideTheActiveWin(S, "right")) + then + return D.log(p.event, "skip enter on side") + end + local refresh = S.scanLayout(S, p.event) if not vim.api.nvim_win_is_valid(S.getSideID(S, "curr")) then @@ -241,8 +248,7 @@ function N.enable(scope) p.event = string.format("%s:skipEnteringNoNeckPainBuffer", p.event) if not S.isActiveTabRegistered(S) - or not S.isActiveTabRegistered(S) - or E.skip() + or E.skip(S.getTab(S)) or S.getScratchPad(S) then return D.log(p.event, "skip") diff --git a/lua/no-neck-pain/state.lua b/lua/no-neck-pain/state.lua index d72a3fc7..2967a481 100644 --- a/lua/no-neck-pain/state.lua +++ b/lua/no-neck-pain/state.lua @@ -74,7 +74,7 @@ end ---Iterates over the tabs in the state to remove invalid tabs. --- ----@param skipID number: the ID to skip from potentially valid tabs. +---@param skipID number?: the ID to skip from potentially valid tabs. ---@return number: the total `tabs` in the state. ---@private function State:refreshTabs(skipID)