diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 3659f9a..98ecbb6 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -23,7 +23,7 @@ M.ui = { statusline = { separator_style = "default", -- default/round/block/arrow - config = "%!v:lua.require('ui.statusline')", + config = "%!v:lua.require('ui.statusline').run()", override = {}, }, diff --git a/lua/ui/statusline/init.lua b/lua/ui/statusline/init.lua index 9b73c09..76c9416 100644 --- a/lua/ui/statusline/init.lua +++ b/lua/ui/statusline/init.lua @@ -1,19 +1,22 @@ local modules = require "ui.statusline.modules" - local user_override = require("core.utils").load_config().ui.statusline.override modules = vim.tbl_deep_extend("force", modules, user_override) -return table.concat { - modules.mode(), - modules.fileInfo(), - modules.git(), +return { + run = function() + return table.concat { + modules.mode(), + modules.fileInfo(), + modules.git(), - "%=", - modules.LSP_progress(), - "%=", + "%=", + modules.LSP_progress(), + "%=", - modules.LSP_Diagnostics(), - modules.LSP_status() or "", - modules.cwd(), - modules.cursor_position(), + modules.LSP_Diagnostics(), + modules.LSP_status() or "", + modules.cwd(), + modules.cursor_position(), + } + end, }