Skip to content

Commit 7aa6057

Browse files
committed
fix(statusline, statuscolumn, winbar): Fixed a bug preventing windows from attaching
Fixed condition for detecting custom bars & lines.
1 parent 06ad70f commit 7aa6057

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lua/bars/statuscolumn.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ statuscolumn.attach = function (window, ignore_enabled)
331331
elseif statuscolumn.state.attached_windows[window] == true then
332332
-- Do not attach if **already attached to a window**.
333333
return;
334-
elseif vim.wo[window].statuscolumn ~= vim.g.__statuscolumn and force_attach() ~= true then
334+
elseif vim.wo[window].statuscolumn ~= STC and vim.wo[window].statuscolumn ~= vim.g.__statuscolumn and force_attach() ~= true then
335335
-- Do not attach to windows with `custom statuscolumn`.
336336
return;
337337
end

lua/bars/statusline.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ statusline.attach = function (window)
604604
elseif statusline.state.attached_windows[window] == true then
605605
-- Do not attach if **already attached to a window**.
606606
return;
607-
elseif vim.wo[window].statusline ~= vim.g.__statusline and force_attach() ~= true then
607+
elseif vim.wo[window].statusline ~= STL and vim.wo[window].statusline ~= vim.g.__statusline and force_attach() ~= true then
608608
-- Do not attach to windows with `custom statusline`.
609609
return;
610610
end

lua/bars/winbar.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ winbar.attach = function (window, ignore_enabled)
692692
elseif winbar.state.attached_windows[window] == true then
693693
-- Do not attach if **already attached to a window**.
694694
return;
695-
elseif vim.wo[window].winbar ~= vim.g.__winbar and force_attach() ~= true then
695+
elseif vim.wo[window].winbar ~= WBR and vim.wo[window].winbar ~= vim.g.__winbar and force_attach() ~= true then
696696
-- Do not attach to windows with `custom winbar`.
697697
return;
698698
end

0 commit comments

Comments
 (0)