fix: reuse component ids while reloading all components

fixes #722
This commit is contained in:
shadmansaleh 2022-07-06 20:36:07 +06:00
parent 5113cdb32f
commit d5002d95a1
2 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,9 @@ local M = require('lualine.utils.class'):extend()
-- Used to provide a unique id for each component
local component_no = 1
function M._reset_component_id()
component_no = 1
end
-- variable to store component output for manipulation
M.status = ''

View File

@ -202,6 +202,7 @@ end
---loads sections and extensions or entire user config
---@param config table user config
local function load_all(config)
require'lualine.component'._reset_component_id()
load_components(config)
load_extensions(config)
end