todo-comments.nvim
todo-comments.nvim copied to clipboard
bug: Weird keyword highlighting without treesitter parser
Did you check docs and existing issues?
- [X] I have read all the todo-comments.nvim docs
- [X] I have updated the plugin to the latest version before submitting this issue
- [X] I have searched the existing issues of todo-comments.nvim
- [X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.10.0
Operating system/version
Ubuntu 22.04.1
Describe the bug
Probably related to #189, and I'm pretty sure the comment parser is not installed.
In a lua file:
In a toml file:
Of all the file types I commonly use only toml
seems to have this problem.
So maybe it's a treesitter issue?
Steps To Reproduce
-
echo $'-- TODO: todo\n-- FIXME: fixme\n-- NOTE: note' > test.lua
-
echo $'# TODO: todo\n# FIXME: fixme\n# NOTE: note' > test.toml
-
nvim -u repro.lua test.lua
→ comments are greyed out for some reason -
:e test.toml
→ comments are colored, but the background of TODO and FIXME is highlighted.
If in step 3. you open test.toml
instead, comments are greyed out and the background of TODO and FIXME is highlighted.
Expected Behavior
Keywords shouldn't have background highlighting.
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/todo-comments.nvim",
opts = { highlight = { keyword = "fg" } },
},
},
})