You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code above vim.iter(t):flatten():totable() is not equivalent to vim.tbl_flatten, since vim.iter(t):flatten():totable() will throw if we pass a non-array-like table where's vim.tbl_flatten will include the items with valid numeric keys (1..n) and will stop once it encounters an invalid one (additional_args in this case, but could be a different one, e.g. bufnr, etc)
telescope: health#telescope#check
Checking for required plugins ~
- OK plenary installed.
- WARNING nvim-treesitter not found. (Required for `:Telescope treesitter`.)
Checking external dependencies ~
- OK rg: found ripgrep 14.1.1
- OK fd: found fd 10.2.0
===== Installed extensions ===== ~
Steps to reproduce
nvim -nu minimal.lua
Press space on a keyboard
Expected behavior
Telescope opens and searching works.
Actual behavior
Telescope doesn't open and the following error is shown:
E5108: Error executing lua: ...talls/neovim/nightly/share/nvim/runtime/lua/vim/iter.lua:251: flatten() requires an array-like table
stack traceback:
[C]: in function 'error'
...talls/neovim/nightly/share/nvim/runtime/lua/vim/iter.lua:251: in function 'flatten'
/tmp/nvim/site/telescope/lua/telescope/utils.lua:23: in function 'flatten'
/tmp/nvim/site/telescope/lua/telescope/builtin/__files.lua:156: in function 'v'
/tmp/nvim/site/telescope/lua/telescope/builtin/__files.lua:645: in function 'v'
/tmp/nvim/site/telescope/lua/telescope/builtin/init.lua:587: in function 'live_grep'
/Users/archil/scripts/minimal.lua:15: in function </Users/archil/scripts/minimal.lua:14>
archilkarchava
changed the title
Telescope doesn't work when dict-like tables are passed to the flatten util
live_grep doesn't work with additional_args (neovim 0.11)
Oct 25, 2024
archilkarchava
changed the title
live_grep doesn't work with additional_args (neovim 0.11)
live_grep with additional_args doesn't work (neovim 0.11)
Oct 25, 2024
archilkarchava
added a commit
to archilkarchava/astronvim_config
that referenced
this issue
Oct 27, 2024
Description
The problem is with this code:
lua/telescope/utils.lua
In the code above
vim.iter(t):flatten():totable()
is not equivalent tovim.tbl_flatten
, sincevim.iter(t):flatten():totable()
will throw if we pass a non-array-like table where'svim.tbl_flatten
will include the items with valid numeric keys (1..n) and will stop once it encounters an invalid one (additional_args
in this case, but could be a different one, e.g.bufnr
, etc)Neovim version
Operating system and version
macOS 14.7
Telescope version / branch / rev
master (df534c3 commit)
checkhealth telescope
Steps to reproduce
nvim -nu minimal.lua
space
on a keyboardExpected behavior
Telescope opens and searching works.
Actual behavior
Telescope doesn't open and the following error is shown:
E5108: Error executing lua: ...talls/neovim/nightly/share/nvim/runtime/lua/vim/iter.lua:251: flatten() requires an array-like table
stack traceback:
[C]: in function 'error'
...talls/neovim/nightly/share/nvim/runtime/lua/vim/iter.lua:251: in function 'flatten'
/tmp/nvim/site/telescope/lua/telescope/utils.lua:23: in function 'flatten'
/tmp/nvim/site/telescope/lua/telescope/builtin/__files.lua:156: in function 'v'
/tmp/nvim/site/telescope/lua/telescope/builtin/__files.lua:645: in function 'v'
/tmp/nvim/site/telescope/lua/telescope/builtin/init.lua:587: in function 'live_grep'
/Users/archil/scripts/minimal.lua:15: in function </Users/archil/scripts/minimal.lua:14>
Minimal config
The text was updated successfully, but these errors were encountered: