From 97e155f3a263e96ca48bf9dc9ec8f7599ceedcd1 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 27 Aug 2021 09:58:54 +0530 Subject: [PATCH] use nerdfont glyphs for lsp progress spinners --- lua/plugins/configs/statusline.lua | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lua/plugins/configs/statusline.lua b/lua/plugins/configs/statusline.lua index 9467856..a1830e8 100644 --- a/lua/plugins/configs/statusline.lua +++ b/lua/plugins/configs/statusline.lua @@ -181,20 +181,25 @@ components.mid.active[1] = { local percentage = Lsp.percentage or 0 local title = Lsp.title or "" local spinners = { - "󰝦", - "󰪞", - "󰪟", - "󰪠", - "󰪡", - "󰪢", - "󰪣", - "󰪤", - "󰪥", + "", + "", + "", + } + + local success_icon = { + "", + "", + "", } local ms = vim.loop.hrtime() / 1000000 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 return "" end,