File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 44--- @field filetype Filetype
55
66--- @class Config
7- --- @field main ? { width ? : number | fun (): number ; }
7+ --- @field main ? { width : number | fun (): number ; }
88--- @field top ? Integration[]
99--- @field right ? { min_width ?: number ; [number] : Integration[] }
1010--- @field bottom ? Integration[]
1717--- @field bottom Integration[]
1818--- @field left { min_width : number ; [number] : Integration[] }
1919
20+ local default_width = 148
2021--- @type ConfigOptions
2122local opts = {
22- main = { width = 148 },
23+ main = { width = default_width },
2324 top = {},
2425 right = { min_width = 46 },
2526 bottom = {},
@@ -32,9 +33,12 @@ local state = {
3233--- Resolves the configured main width.
3334--- @return number
3435local function get_main_width ()
35- local width = opts .main .width
36+ local width = opts .main and opts . main .width
3637 if type (width ) == " function" then
37- return width ()
38+ width = width ()
39+ end
40+ if type (width ) ~= " number" then
41+ return default_width
3842 end
3943 return width
4044end
You can’t perform that action at this time.
0 commit comments