Skip to content

Commit d658a10

Browse files
committed
refactor(utils): switch to vim.validate() form 1 for Neovim 0.11+
Replaced custom assert() checks with official vim.validate() form 1, as recommended in Neovim 0.11+ to ensure better consistency with core APIs and forward compatibility.
1 parent b161ce0 commit d658a10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/dashboard/utils.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function utils.element_align(tbl)
2626
end
2727

2828
function utils.get_max_len(contents)
29-
assert(type(contents) == 'table', 'contents must be a table')
29+
vim.validate('contents', contents, 'table')
3030
local cells = {}
3131
for _, v in pairs(contents) do
3232
table.insert(cells, vim.api.nvim_strwidth(v))
@@ -36,7 +36,7 @@ function utils.get_max_len(contents)
3636
end
3737

3838
function utils.center_align(tbl)
39-
assert(type(tbl) == 'table', 'tbl must be a table')
39+
vim.validate('tbl', tbl, 'table')
4040
local function fill_sizes(lines)
4141
local fills = {}
4242
for _, line in pairs(lines) do

0 commit comments

Comments
 (0)