Skip to content

Commit abf4ac4

Browse files
committed
feat(config): add table for configuring winbar whitelist/blacklist
1 parent bbc1f57 commit abf4ac4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ require("astroui").setup({
103103
breadcrumbs = "",
104104
path = "",
105105
},
106+
-- Configure enabling/disabling of winbar
107+
winbar = {
108+
enabled = { -- whitelist buffer patterns
109+
filetype = { "gitsigns.blame" },
110+
},
111+
disabled = { -- blacklist buffer patterns
112+
buftype = { "nofile", "terminal" },
113+
},
114+
},
106115
},
107116
}
108117
```

lua/astroui/config.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
---@field breadcrumbs string? Separator used in between symbols in the breadcrumbs
3939
---@field path string? Separator used in between symbols in a file path
4040

41+
---@class AstroUIWinbar
42+
---@field enabled table<BufMatcherKinds, BufMatcherPattern[]>? Buffer matching patterns for whitelisting buffers to enable winbar
43+
---@field disabled table<BufMatcherKinds, BufMatcherPattern[]>? Buffer matching patterns for blacklisting buffers from enabling winbar
44+
4145
---@class AstroUIStatusOpts
4246
---Configure attributes of components defined in the `status` API. Check the AstroNvim documentation for a complete list of color names, this applies to colors that have `_fg` and/or `_bg` names with the suffix removed (ex. `git_branch_fg` as attributes from `git_branch`).
4347
---Example:
@@ -105,6 +109,8 @@
105109
---}
106110
---```
107111
---@field separators AstroUISeparators?
112+
---Configure when winbar is enabled/disabled
113+
---@field winbar AstroUIWinbar?
108114
---**MEANT FOR INTERNAL USE ONLY**
109115
---Function used for setting up colors in Heirline, the entry point to this are typically through the `status.colors` option.
110116
---@field setup_colors (fun():StringMap)?
@@ -197,6 +203,7 @@ local M = {
197203
separators = {},
198204
setup_colors = nil,
199205
sign_handlers = {},
206+
winbar = {},
200207
},
201208
}
202209

0 commit comments

Comments
 (0)