Skip to content

Commit

Permalink
feat: load recent files after LazyVimStarted
Browse files Browse the repository at this point in the history
  • Loading branch information
TwIStOy committed Nov 28, 2023
1 parent 3d07e6b commit df47262
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lua/ht/plugins/ui/alpha-nvim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ if Const.is_gui then
dependencies[#dependencies + 1] = "TwIStOy/project.nvim"
end

local after_lazy_vim_started = false

local M = {
"goolord/alpha-nvim",
cond = function()
Expand Down Expand Up @@ -262,7 +264,16 @@ local function build_recent_files_section()
{
type = "group",
val = function()
return { mru(1, vim.fn.getcwd(), 5) }
if after_lazy_vim_started then
return { mru(1, vim.fn.getcwd(), 5) }
else
return {
{
type = "text",
val = "Loading...",
},
}
end
end,
opts = { shrink_margin = false },
},
Expand Down Expand Up @@ -424,6 +435,7 @@ M.config = function() -- code to run after plugin loaded
pattern = "LazyVimStarted",
once = true,
callback = function()
after_lazy_vim_started = true
require("alpha").redraw()
end,
})
Expand Down

0 comments on commit df47262

Please sign in to comment.