Skip to content

Commit 38973ca

Browse files
clasonkylechui
andauthored
fix: replace deprecated vim.tbl_islist by native Lua function (#323)
* fix: replace deprecated `vim.tbl_islist` by native Lua function This is also arguably more correct, since the previous version would also wrap non-list tables like `{ 1 = 'a', 3 = 'b' }`. Fixes #321 --------- Co-authored-by: Kyle Chui <[email protected]>
1 parent 6d0dc3d commit 38973ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/nvim-surround/functional.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local M = {}
55
---@param t T|T[]|nil The input element.
66
---@return T[]|nil @The input wrapped in a list, if necessary.
77
M.to_list = function(t)
8-
if not t or vim.tbl_islist(t) then
8+
if not t or type(t) == "table" then
99
return t
1010
end
1111
return { t }

0 commit comments

Comments
 (0)