Skip to content

Commit

Permalink
fix: adapt to nvim depractions (#379)
Browse files Browse the repository at this point in the history
Possibly fixes #370. Looks like `vim.iter(...):flatten():totable()` is NOT a exact drop-in replacement of `vim.tbl_flatten`. It does not handle nil values. Fixes were made in neovim/neovim#28781 to address the issue.
  • Loading branch information
sidlatau authored Aug 23, 2024
1 parent de817aa commit e951b0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/flutter-tools/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@ end
-- TODO: Remove after compatibility with Neovim=0.9 is dropped
M.islist = vim.fn.has("nvim-0.10") == 1 and vim.islist or vim.tbl_islist
local flatten = function(t) return vim.iter(t):flatten():totable() end
M.flatten = vim.fn.has("nvim-0.10") == 1 and flatten or vim.tbl_flatten
M.flatten = vim.fn.has("nvim-0.11") == 1 and flatten or vim.tbl_flatten

return M

0 comments on commit e951b0a

Please sign in to comment.