feat: Expose current config with lualine.get_config()

This commit is contained in:
shadmansaleh 2021-08-04 07:13:37 +06:00
parent 7b98680316
commit 6aecf4a341
4 changed files with 26 additions and 2 deletions

View File

@ -105,6 +105,13 @@ require'lualine'.setup {
</details> </details>
If you want to get your current lualine config. you can
do so with
```lua
require'lualine'.get_config()
```
--- ---
### Starting lualine ### Starting lualine
```lua ```lua

View File

@ -66,6 +66,11 @@ Default config~
extensions = {} extensions = {}
} }
If you want to get your current lualine config. you can
do so with >
require'lualine'.get_config()
<
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
STARTING LUALINE *lualine-starting_lualine* *lualine.setup()* STARTING LUALINE *lualine-starting_lualine* *lualine.setup()*
> >

View File

@ -69,4 +69,11 @@ local function apply_configuration(config_table)
return vim.deepcopy(config) return vim.deepcopy(config)
end end
return {config = vim.deepcopy(config), apply_configuration = apply_configuration} local function get_current_conifg()
return vim.deepcopy(config)
end
return {
get_config = get_current_conifg,
apply_configuration = apply_configuration
}

View File

@ -237,4 +237,9 @@ local function setup(user_config)
set_tabline() set_tabline()
end end
return {setup = setup, statusline = status_dispatch, tabline = tabline} return {
setup = setup,
statusline = status_dispatch,
tabline = tabline,
get_config = config_module.get_config,
}