fix(snacks): safe wrapper around snacks statuscolumn to prevent errors when LazyVim is still installing

This commit is contained in:
Folke Lemaitre
2025-09-18 09:46:49 +02:00
parent bd1f523df5
commit 5bf237820d
2 changed files with 6 additions and 1 deletions

View File

@@ -104,7 +104,7 @@ opt.spelllang = { "en" }
opt.splitbelow = true -- Put new windows below current
opt.splitkeep = "screen"
opt.splitright = true -- Put new windows right of current
opt.statuscolumn = [[%!v:lua.require'snacks.statuscolumn'.get()]]
opt.statuscolumn = [[%!v:lua.LazyVim.statuscolumn()]]
opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key

View File

@@ -299,4 +299,9 @@ function M.memoize(fn)
end
end
-- Safe wrapper around snacks to prevent errors when LazyVim is still installing
function M.statuscolumn()
return package.loaded.snacks and require("snacks.statuscolumn").get() or ""
end
return M