-
-
Notifications
You must be signed in to change notification settings - Fork 629
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Not sure if this is the right place for this bug. But I suspect NvimTree could be the problem.
When opening a file of ~ 1-2k lines on my machine using Telescope. The neovim treesitter api complains about invalid window ID. Which is the window ID of the NvimTree window. This leads to any long files not having syntax highlighting when using these plugins.
Neovim version
NVIM v0.11.2
Build type: RelWithDebInfo
LuaJIT 2.1.1748459687
Operating system and version
Linux 6.15.2-arch1-1
Windows variant
No response
nvim-tree version
v1.13.0
Clean room replication
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvt-min/site]])
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
require("packer").startup({
{
"wbthomason/packer.nvim",
"nvim-tree/nvim-tree.lua",
"nvim-tree/nvim-web-devicons",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-treesitter/nvim-treesitter",
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
},
config = {
package_root = package_root,
compile_path = install_path .. "/plugin/packer_compiled.lua",
display = { non_interactive = true },
},
})
end
if vim.fn.isdirectory(install_path) == 0 then
print("Installing nvim-tree and dependencies.")
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end
load_plugins()
require("packer").sync()
vim.cmd([[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]])
vim.opt.termguicolors = true
vim.opt.cursorline = true
-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
require("nvim-tree").setup({})
-- Setup treesitter as it contributes to the failure.
require'nvim-treesitter.configs'.setup {
ensure_installed = {
"lua",
},
sync_install = true,
highlight = { enable = true }
}
end
Steps to reproduce
- nvim -nu /tmp/nvt-min.lua
- :NvimTreeOpen
- Run this to check the window id of the NvimTree buffer:
:lua for i = 1, vim.fn.winnr('$') do print('Window ' .. i .. ' ID: ' .. vim.fn.win_getid(i)) end
- Move cursor to NvimTreeBuffer
- :Telescope find_files
- Choose a large file. Example: https://github.com/jzho987/nvim/blob/bug-setup/long.lua
- Jump to said file.
Expected behavior
Expected the file to correctly open, and syntax highlight to work. No errors should be thrown.
Actual behavior
Error gets thrown. Syntax highlighting no longer works.
Note the nvimtree window id should be the same as what was printed in the step 3
apollo1321
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working