@@ -826,6 +826,8 @@ winbar.clean = function ()
826
826
--- | fE
827
827
end
828
828
829
+ ---- ------------------------------------------------------------------
830
+
829
831
--- Toggles state of given window.
830
832
--- @param window integer
831
833
winbar .toggle = function (window )
@@ -851,6 +853,52 @@ winbar.Toggle = function ()
851
853
winbar .state .enable = not winbar .state .enable ;
852
854
end
853
855
856
+ ---- ------------------------------------------------------------------
857
+
858
+ --- Enables winbar for `window`.
859
+ --- @param window integer
860
+ winbar .enable = function (window )
861
+ if type (window ) ~= " number" or winbar .state .attached_windows [window ] == nil then
862
+ return ;
863
+ end
864
+
865
+ winbar .attach (window );
866
+ end
867
+
868
+ --- Enables *all* attached windows.
869
+ winbar .Enable = function ()
870
+ winbar .state .enable = true ;
871
+
872
+ for window , state in pairs (winbar .state .attached_windows ) do
873
+ if state ~= true then
874
+ winbar .attach (window );
875
+ end
876
+ end
877
+ end
878
+
879
+ --- Disables winbar for `window`.
880
+ --- @param window integer
881
+ winbar .disable = function (window )
882
+ if type (window ) ~= " number" or winbar .state .attached_windows [window ] == nil then
883
+ return ;
884
+ end
885
+
886
+ winbar .detach (window );
887
+ end
888
+
889
+ --- Disables *all* attached windows.
890
+ winbar .Disable = function ()
891
+ for window , state in pairs (winbar .state .attached_windows ) do
892
+ if state ~= false then
893
+ winbar .detach (window );
894
+ end
895
+ end
896
+
897
+ winbar .state .enable = false ;
898
+ end
899
+
900
+ ---- ------------------------------------------------------------------
901
+
854
902
--- Sets up the winbar module.
855
903
--- @param config winbar.config | nil
856
904
winbar .setup = function (config )
0 commit comments