From c19398b3f6254626b866e7e7217357d7cbf8499c Mon Sep 17 00:00:00 2001 From: siduck Date: Mon, 4 Jul 2022 11:51:43 +0530 Subject: [PATCH] fix #1309 --- lua/core/default_config.lua | 2 +- lua/ui/statusline/init.lua | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) 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, }