Skip to content

Commit ed424c4

Browse files
committed
update docs + do not allow primary refresh timer to be set to 0
1 parent c24f835 commit ed424c4

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ require('lualine').setup {
145145
always_show_tabline = true,
146146
globalstatus = false,
147147
refresh = {
148-
statusline = 100,
149-
tabline = 100,
150-
winbar = 100,
148+
statusline = 1000,
149+
tabline = 1000,
150+
winbar = 1000,
151151
refresh_time = 16, -- ~60fps
152152
events = {
153153
'WinEnter',

lua/lualine/config.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ local config = {
6161
extensions = {},
6262
}
6363

64+
--- Ensure sure user config doesn't disable lualine refresh completely
65+
---@param options table
66+
---@return table
67+
local function fix_refresh_timer(options)
68+
if options.refresh.refresh_time <= 0 then
69+
options.refresh.refresh_time = 16
70+
end
71+
return options
72+
end
73+
6474
--- change separator format 'x' to {left='x', right='x'}
6575
---@param separators string|table
6676
---@return table
@@ -131,6 +141,7 @@ local function apply_configuration(config_table)
131141
if config_table.extensions then
132142
config.extensions = utils.deepcopy(config_table.extensions)
133143
end
144+
config.options = fix_refresh_timer(config.options)
134145
config.options.section_separators = fix_separators(config.options.section_separators)
135146
config.options.component_separators = fix_separators(config.options.component_separators)
136147
config.options.disabled_filetypes = fix_disabled_filetypes(config.options.disabled_filetypes)

0 commit comments

Comments
 (0)