Skip to content

Commit

Permalink
feat: allow completely disabling statusline
Browse files Browse the repository at this point in the history
  • Loading branch information
famiu committed Sep 11, 2021
1 parent 8254d59 commit bd6269d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ Default:
bufnames = {}
}
```
- `disable` - Similar to `force_inactive`, except the statusline is disabled completely. Configured the same way as `force_inactive`
- `vi_mode_colors` - A table containing colors associated with Vi modes. It can later be used to get the color associated with the current Vim mode using `require('feline.providers.vi_mode').get_mode_color()`. For more info on it see the [Vi-mode](#vi-mode) section.<br><br>Here is a list of all possible vi_mode names used with the default color associated with them:

| Mode | Description | Value |
Expand Down Expand Up @@ -819,6 +820,13 @@ local force_inactive = {
bufnames = {}
}

-- This table is equal to the default disable table
local disable = {
filetypes = {},
buftypes = {},
bufnames = {}
}

-- This table is equal to the default update_triggers table
local update_triggers = {
'VimEnter',
Expand All @@ -832,6 +840,7 @@ require('feline').setup({
separators = separators,
vi_mode_colors = vi_mode_colors,
force_inactive = force_inactive,
disable = disable,
update_triggers = update_triggers,
components = components
})
Expand Down
6 changes: 6 additions & 0 deletions lua/feline/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ M.force_inactive = {
bufnames = {}
}

M.disable = {
filetypes = {},
buftypes = {},
bufnames = {}
}

M.update_triggers = {
'VimEnter',
'WinEnter',
Expand Down
2 changes: 1 addition & 1 deletion lua/feline/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local function is_forced_inactive()
vim.tbl_contains(force_inactive.bufnames, bufname)
end

-- Check if buffer contained in current window is configured to have statusline disabled
-- Check if buffer contained in window is configured to have statusline disabled
local function is_disabled(winid)
local disable = {buftypes = {}, filetypes = {}, bufnames = {}}

Expand Down
1 change: 1 addition & 0 deletions lua/feline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function M.setup(config)
end

M.force_inactive = parse_config(config, 'force_inactive', 'table', defaults.force_inactive)
M.disable = parse_config(config, 'force_inactive', 'table', defaults.disable)
M.update_triggers = defaults.update_triggers

for _, trigger in ipairs(parse_config(config, 'update_triggers', 'table', {})) do
Expand Down

0 comments on commit bd6269d

Please sign in to comment.