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
Triggering incremental selection in an empty file will report an error.
This is my configuration:
-- https://github.com/nvim-treesitter/nvim-treesitterrequire'nvim-treesitter.configs'.setup({
-- a list of parser names, or "all" (the four listed parsers should always be installed)-- https://github.com/nvim-treesitter/nvim-treesitter#supported-languagesensure_installed= {"bash", "vim", "lua", "go", "sql", "php", "javascript", "vue", "css", "json", "yaml",
"markdown", "dockerfile"},
highlight= {
enable=true,
disable=function(lang, buf)
localmax_filesize=100*1024-- 100 KBlocalok, stats=pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
ifokandstatsandstats.size>max_filesizethenreturntrueendend,
-- setting this to true will run `:h syntax` and tree-sitter at the same time.-- set this to `true` if you depend on 'syntax' being enabled (like for indentation).-- using this option may slow down your editor, and you may see some duplicate highlights.-- instead of true it can also be a list of languagesadditional_vim_regex_highlighting=false
},
incremental_selection= {
enable=true,
keymaps= {
init_selection="<CR>",
node_incremental="<CR>",
node_decremental="<BS>",
scope_incremental="<Tab>",
},
},
})
To Reproduce
Create an empty file
nvim t.go
Click enter
You can see the error
E5108: Error executing lua: ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:190: attempt to index local'node_or_range' (a nil value) stack traceback:
...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:190: infunction'get_node_range'
...im/lazy/nvim-treesitter/lua/nvim-treesitter/ts_utils.lua:279: infunction'update_selection'
...treesitter/lua/nvim-treesitter/incremental_selection.lua:18: infunction<...treesitter/lua/nvim-treesitter/incremental_selection.lua:14>
Expected behavior
no error will occur
Output of :checkhealth nvim-treesitter
==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()
Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v21.2.0 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: Apple clang version 15.0.0 (clang-1500.0.40.1)
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
OS Info:
{
machine = "x86_64",
release = "23.1.0",
sysname = "Darwin",
version = "Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:27 PDT 2023; root:xnu-10002.41.9~6/RELEASE_X86_64"
} ~
Parser/Features H L F I J
- bash ✓ ✓ ✓ . ✓
- c ✓ ✓ ✓ ✓ ✓
- css ✓ . ✓ ✓ ✓
- dockerfile ✓ . . . ✓
- go ✓ ✓ ✓ ✓ ✓
- javascript ✓ ✓ ✓ ✓ ✓
- json ✓ ✓ ✓ ✓ .
- lua ✓ ✓ ✓ ✓ ✓
- markdown ✓ . ✓ ✓ ✓
- php ✓ ✓ ✓ ✓ ✓
- query ✓ ✓ ✓ ✓ ✓
- solidity ✓ . ✓ . .
- sql ✓ . . ✓ ✓
- vim ✓ ✓ ✓ . ✓
- vimdoc ✓ . . . ✓
- vue ✓ . ✓ ✓ ✓
- yaml ✓ ✓ ✓ ✓ ✓
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang} ~
Output of nvim --version
NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1699801871
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/0.9.4/share/nvim"
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Triggering incremental selection in an empty file will report an error.
This is my configuration:
To Reproduce
Expected behavior
no error will occur
Output of
:checkhealth nvim-treesitter
Output of
nvim --version
Additional context
No response
The text was updated successfully, but these errors were encountered: