pojokcodeid.nvim-lazy/lua/plugins/lspprogress.lua

61 lines
1.3 KiB
Lua
Raw Normal View History

2023-03-03 19:15:17 +07:00
local fidget = true
local lualine = false
local data_exists, custom_ui = pcall(require, "core.config")
2023-03-03 19:15:17 +07:00
if data_exists then
if type(custom_ui) == "table" then
if custom_ui.progress == 1 then
fidget = false
lualine = true
elseif custom_ui.progress == 2 then
fidget = true
lualine = false
elseif custom_ui.progress == 0 then
fidget = false
lualine = false
else
fidget = true
lualine = false
end
end
else
fidget = true
lualine = false
end
return {
{
"j-hui/fidget.nvim",
enabled = fidget,
2023-06-12 07:11:47 +07:00
tag = "legacy",
2023-03-03 19:15:17 +07:00
event = "BufRead",
config = function()
2024-02-21 17:19:44 +07:00
require("fidget").setup({
window = {
blend = 0,
relative = "editor",
},
})
2023-03-03 19:15:17 +07:00
end,
},
{
"linrongbin16/lsp-progress.nvim",
enabled = lualine,
branch = "main",
event = { "BufRead" },
config = function()
require("lsp-progress").setup({
2023-03-03 21:44:37 +07:00
client_format = function(client_name, spinner, series_messages)
2024-03-02 18:32:21 +07:00
return #series_messages > 0
and (spinner .. " " .. string.sub(table.concat(series_messages, ", "), 1, 25) .. " ...")
or nil
2023-03-03 21:44:37 +07:00
end,
2023-03-03 19:15:17 +07:00
format = function(client_messages)
2023-03-03 21:44:37 +07:00
local sign = ""
2024-03-02 18:32:21 +07:00
return #client_messages > 0
and (sign .. " " .. string.sub(table.concat(client_messages, " "), 1, 25) .. " ...")
or sign
2023-03-03 19:15:17 +07:00
end,
})
end,
},
}