Skip to content

Commit

Permalink
fix: unused skips
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Jun 30, 2024
1 parent 776caec commit 4194778
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions lua/no-neck-pain/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,39 +244,21 @@ function N.enable(scope)
vim.api.nvim_create_autocmd({ "WinEnter", "WinClosed" }, {
callback = function(p)
vim.schedule(function()
local s = string.format("%s:integration", p.event)
if
not S.isActiveTabRegistered(S)
or not S.isActiveTabRegistered(S)
or E.skip(S.getTab(S))
then
return D.log(s, "skip")
if not S.isActiveTabRegistered(S) or E.skip(S.getTab(S)) then
return D.log(p.event, "skip")
end

S.refreshVSplits(S, scope)

if S.wantsSides(S) and S.checkSides(S, "and", false) then
return D.log(s, "no side buffer")
return D.log(p.event, "no side buffer")
end

if p.event == "WinClosed" and not S.hasIntegrations(S) then
return D.log(s, "no registered integration")
end

local unregistered = S.getUnregisteredWins(S)
if p.event == "WinEnter" and #unregistered == 0 then
return D.log(s, "no new windows")
end

if
p.event == "WinEnter"
and #unregistered == 1
and not S.isSupportedIntegration(S, s, unregistered[1])
then
return D.log(s, "encountered a new window, not an integration")
return D.log(p.event, "no registered integration")
end

N.init(s, false, true)
N.init(p.event, false, true)
end)
end,
group = augroupName,
Expand Down

0 comments on commit 4194778

Please sign in to comment.