mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2024-12-13 13:30:41 +00:00
use nerdfont glyphs for lsp progress spinners
This commit is contained in:
parent
f7ff16e84e
commit
97e155f3a2
1 changed files with 15 additions and 10 deletions
|
@ -181,20 +181,25 @@ components.mid.active[1] = {
|
||||||
local percentage = Lsp.percentage or 0
|
local percentage = Lsp.percentage or 0
|
||||||
local title = Lsp.title or ""
|
local title = Lsp.title or ""
|
||||||
local spinners = {
|
local spinners = {
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
}
|
||||||
"",
|
|
||||||
"",
|
local success_icon = {
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
}
|
}
|
||||||
|
|
||||||
local ms = vim.loop.hrtime() / 1000000
|
local ms = vim.loop.hrtime() / 1000000
|
||||||
local frame = math.floor(ms / 120) % #spinners
|
local frame = math.floor(ms / 120) % #spinners
|
||||||
return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage)
|
|
||||||
|
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
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in a new issue