diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2024-04-19 18:12:54 +0100 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | 0bb981c87604200df6c8fb81e5a411101bdf93af (patch) | |
| tree | 24f84c282410494da3a95b75a60f7487c6ec957f /plugin | |
| parent | feat: improve logging of failed installs (diff) | |
| download | nvim-treesitter-0bb981c87604200df6c8fb81e5a411101bdf93af.tar nvim-treesitter-0bb981c87604200df6c8fb81e5a411101bdf93af.tar.gz nvim-treesitter-0bb981c87604200df6c8fb81e5a411101bdf93af.tar.bz2 nvim-treesitter-0bb981c87604200df6c8fb81e5a411101bdf93af.tar.lz nvim-treesitter-0bb981c87604200df6c8fb81e5a411101bdf93af.tar.xz nvim-treesitter-0bb981c87604200df6c8fb81e5a411101bdf93af.tar.zst nvim-treesitter-0bb981c87604200df6c8fb81e5a411101bdf93af.zip | |
fix: do not use vim.iter (#6469)
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/nvim-treesitter.lua | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index 0bcbe07c3..751e8aad1 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -6,15 +6,23 @@ vim.g.loaded_nvim_treesitter = true local api = vim.api local function complete_available_parsers(arglead) - return vim.iter.filter(function(v) - return v:find(arglead) - end, require('nvim-treesitter.parsers').get_available()) + return vim.tbl_filter( + --- @param v string + function(v) + return v:find(arglead) ~= nil + end, + require('nvim-treesitter.parsers').get_available() + ) end local function complete_installed_parsers(arglead) - return vim.iter.filter(function(v) - return v:find(arglead) - end, require('nvim-treesitter.config').installed_parsers()) + return vim.tbl_filter( + --- @param v string + function(v) + return v:find(arglead) ~= nil + end, + require('nvim-treesitter.config').installed_parsers() + ) end -- create user commands |
