Skip to content

Commit

Permalink
usebuiltin
Browse files Browse the repository at this point in the history
  • Loading branch information
davidosomething committed Nov 6, 2024
1 parent 985cf0b commit 8b2415b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
22 changes: 7 additions & 15 deletions nvim/lua/dko/heirline/dko-heirline-package-info.lua
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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",
}
4 changes: 2 additions & 2 deletions nvim/lua/dko/heirline/winbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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"),
},
}
1 change: 0 additions & 1 deletion nvim/lua/dko/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8b2415b

Please sign in to comment.