clean up!
This commit is contained in:
@@ -43,10 +43,12 @@ local icon_styles = {
|
||||
}
|
||||
|
||||
local config = require("core.utils").load_config().plugins.options.statusline
|
||||
|
||||
-- statusline style
|
||||
local user_statusline_style = config.style
|
||||
local statusline_style = icon_styles[user_statusline_style]
|
||||
-- if show short statusline on small screens
|
||||
|
||||
-- show short statusline on small screens
|
||||
local shortline = config.shortline == false and true
|
||||
|
||||
-- Initialize the components table
|
||||
@@ -55,7 +57,6 @@ local components = {
|
||||
inactive = {},
|
||||
}
|
||||
|
||||
-- Initialize left, mid and right
|
||||
table.insert(components.active, {})
|
||||
table.insert(components.active, {})
|
||||
table.insert(components.active, {})
|
||||
@@ -186,6 +187,7 @@ components.active[1][10] = {
|
||||
components.active[2][1] = {
|
||||
provider = function()
|
||||
local Lsp = vim.lsp.util.get_progress_messages()[1]
|
||||
|
||||
if Lsp then
|
||||
local msg = Lsp.message or ""
|
||||
local percentage = Lsp.percentage or 0
|
||||
@@ -207,10 +209,11 @@ components.active[2][1] = {
|
||||
|
||||
if percentage >= 70 then
|
||||
return string.format(" %%<%s %s %s (%s%%%%) ", success_icon[frame + 1], title, msg, percentage)
|
||||
else
|
||||
return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage)
|
||||
end
|
||||
|
||||
return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage)
|
||||
end
|
||||
|
||||
return ""
|
||||
end,
|
||||
enabled = shortline or function(winid)
|
||||
|
||||
Reference in New Issue
Block a user