Did you check docs and existing issues?
Neovim version (nvim -v)
v0.12.2
Operating system/version
Windows 11, WSL2 Ubuntu 26.04 LTS
Describe the bug
I encounter the following error when enabling Twilight on a .txt file:
I think it has to do with no treesitter parser installed for text filetypes. I also have this issue with other filetypes that treesitter has no parser installed for. After some debugging it seems that the check for this in view.lua contains: `pcall(vim.treesitter.get_parser, buf)` which when I run manually returns (true, nil, ) when a parser isn't installed:
Steps To Reproduce
- The following code will recreate this error in the recreate instance:
vim.o.filetype = "text" -- Set explicitly or open a .txt or other file lacking a treesitter parser
-- Can call :TwilightEnable here to see error
Expected Behavior
I believe the default behavior when no treesitter parser is enabled for the filetype is the revert to the equivalent of treesitter=false in the setup() options.
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
{ "folke/twilight.nvim", opts = { treesitter = true } }, -- This should be default
},
})
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.12.2
Operating system/version
Windows 11, WSL2 Ubuntu 26.04 LTS
Describe the bug
I encounter the following error when enabling Twilight on a .txt file:
I think it has to do with no treesitter parser installed for text filetypes. I also have this issue with other filetypes that treesitter has no parser installed for. After some debugging it seems that the check for this in view.lua contains: `pcall(vim.treesitter.get_parser, buf)` which when I run manually returns (true, nil, ) when a parser isn't installed:
Steps To Reproduce
Expected Behavior
I believe the default behavior when no treesitter parser is enabled for the filetype is the revert to the equivalent of treesitter=false in the setup() options.
Repro