Skip to content

Commit

Permalink
fix: unwanted re-routing
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Jul 8, 2024
1 parent 6968f22 commit 83ca96f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lua/no-neck-pain/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion lua/no-neck-pain/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 83ca96f

Please sign in to comment.