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
I have updated 'mini.nvim' to latest version of the main branch
Module(s)
mini.surround
Neovim version
0.10.x
Description
On both 0.10.x and latest 0.11 nightly (on NixOS via official overlay), an error is thrown when using the keymap associated with the treesitter capture "@parameter.inner" and "@parameter.outer". On 0.10.x, the error is
E5108: Error executing lua ...d-0.10.4/share/nvim/runtime/lua/vim/treesitter/query.lua:952: bad argument #1 to '_create_ts_querycursor' (treesitter_node expected, got table)
stack traceback:
[C]: in function '_create_ts_querycursor'
...d-0.10.4/share/nvim/runtime/lua/vim/treesitter/query.lua:952: in function 'iter_matches'
...ckages/opt/nvim-treesitter/lua/nvim-treesitter/query.lua:251: in function 'iter_group_results'
...ckages/opt/nvim-treesitter/lua/nvim-treesitter/query.lua:320: in function 'get_capture_matches'
...myNeovimPackages/opt/mini.surround/lua/mini/surround.lua:1506: in function <...myNeovimPackages/opt/mini.surround/lua/mini/surround.lua:1505>
vim/shared.lua: in function 'range_pair_querier'
...myNeovimPackages/opt/mini.surround/lua/mini/surround.lua:1040: in function 'input'
[string ":lua"]:1: in main chunk
The corresponding "nvim-treesitter-textobjects" mappings work (i.e. select "ia" and "aa" work)
Reproduction
Using "mini.surround" standalone, with "nvim-treesitter" and "nvim-treesitter-textobjects" installed. All are lazy-loaded with lze on a "DeferredUIEnter" event ("VeryLazy" equivalent). The configurations are
I can reproduce with built-in Lua tree-sitter parser. But this seems to happen only for @parameter.outer+@parameter.inner pair. Using 'nvim-treesitter' (current default) throws error while using built-in vim.treesitter just doesn't find a surrounding. I'll take a look.
As surrounding based on @parameter.{outer,inner} pair doesn't look useful to me (it usually matches a comma and some whitespace), what is your use case for this surrounding?
Actually, it seems I hadn't thought this completely through, you are right that it doesn't really make sense to use. I think I actually wanted the 'saaa{' ('[s]urround [a]dd [a]round [a]rgument [{]') actions, which works with just default 'mini.surround' + 'nvim-treesitter-context'. Should I close this issue or leave it open since it seems to be a bug, albeit quite inconsequential?
Should I close this issue or leave it open since it seems to be a bug, albeit quite inconsequential?
I am pretty sure that it is either 'nvim-treesitter/nvim-treesitter' or vim.treesitter issue. Let's keep it open for a while, so that I'd not forget to try to take a closer look into it.
Contributing guidelines
main
branchModule(s)
mini.surround
Neovim version
0.10.x
Description
On both 0.10.x and latest 0.11 nightly (on NixOS via official overlay), an error is thrown when using the keymap associated with the treesitter capture "@parameter.inner" and "@parameter.outer". On 0.10.x, the error is
The corresponding "nvim-treesitter-textobjects" mappings work (i.e. select "ia" and "aa" work)
Reproduction
Using "mini.surround" standalone, with "nvim-treesitter" and "nvim-treesitter-textobjects" installed. All are lazy-loaded with lze on a "DeferredUIEnter" event ("VeryLazy" equivalent). The configurations are
The text was updated successfully, but these errors were encountered: