diff --git a/nvim/lua/dko/heirline/dko-heirline-package-info.lua b/nvim/lua/dko/heirline/dko-heirline-package-info.lua index 51597fb5..7b261ae5 100644 --- a/nvim/lua/dko/heirline/dko-heirline-package-info.lua +++ b/nvim/lua/dko/heirline/dko-heirline-package-info.lua @@ -1,13 +1,3 @@ -local tick = 0 - ----@see https://github.com/j-hui/fidget.nvim/blob/main/lua/fidget/spinner/patterns.lua -local triangle = { - "◢", - "◣", - "◤", - "◥", -} - return { condition = function() local filename = vim.fn.expand("%:t") @@ -17,11 +7,13 @@ return { update = { "User", pattern = "DkoPackageInfoStatusUpdate" }, provider = function() - tick = tick + 1 - if tick > #triangle then - tick = 1 + local pok, pi = pcall(require, "package-info.ui.generic.loading-status") + if not pok then + return "" end - return (" %s "):format(triangle[tick]) + return pi.state.current_spinner == "" and "" + or (" %s "):format(pi.state.current_spinner) end, - hl = "dkoStatusValue", + + hl = "Comment", } diff --git a/nvim/lua/dko/heirline/winbar.lua b/nvim/lua/dko/heirline/winbar.lua index 8a67cd06..cae23a11 100644 --- a/nvim/lua/dko/heirline/winbar.lua +++ b/nvim/lua/dko/heirline/winbar.lua @@ -74,7 +74,7 @@ return { or "" return (" %s%s "):format(self.icon, spaced_filetype) end, - hl = function(self) + hl = function() return active_highlight("dkoStatusKey") end, }, @@ -202,9 +202,9 @@ return { condition = function() return vim.bo.buftype == "" -- normal end, - -- require("dko.heirline.dko-heirline-package-info"), require("dko.heirline.lsp"), require("dko.heirline.formatters"), require("dko.heirline.diagnostics"), + require("dko.heirline.dko-heirline-package-info"), }, } diff --git a/nvim/lua/dko/plugins/init.lua b/nvim/lua/dko/plugins/init.lua index 14b85f0a..f91bbbf0 100644 --- a/nvim/lua/dko/plugins/init.lua +++ b/nvim/lua/dko/plugins/init.lua @@ -283,7 +283,6 @@ return { local c = require("package-info/utils/constants") vim.api.nvim_create_autocmd("User", { - nested = true, group = c.AUTOGROUP, pattern = c.LOAD_EVENT, callback = function()