mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 09:18:51 +02:00
fix(mini.starter): changes based on echasnovski's recommendation (#3223)
This commit is contained in:
parent
a4d83524a7
commit
eb6c9fb578
1 changed files with 5 additions and 4 deletions
|
@ -63,14 +63,15 @@ return {
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
pattern = "LazyVimStarted",
|
pattern = "LazyVimStarted",
|
||||||
callback = function()
|
callback = function(ev)
|
||||||
local stats = require("lazy").stats()
|
local stats = require("lazy").stats()
|
||||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||||
local pad_footer = string.rep(" ", 8)
|
local pad_footer = string.rep(" ", 8)
|
||||||
starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
||||||
-- INFO: Use `VimResized` to avoid the `buf_id in refresh() is not an identifier of valid Starter buffer`,
|
-- INFO: based on @echasnovski's recommendation (thanks a lot!!!)
|
||||||
-- since `starter.refresh` executes on every `VimResized` see https://github.com/echasnovski/mini.starter/blob/f0c491032dcda485ee740716217cd4d5c25b6014/lua/mini/starter.lua#L352-L353
|
if vim.bo[ev.buf].filetype == "starter" then
|
||||||
vim.cmd([[do VimResized]])
|
pcall(starter.refresh)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue