todo-comments.nvim
todo-comments.nvim copied to clipboard
bug: Disabling highlighting breaks some integrations
Did you check docs and existing issues?
- [X] I have read all the todo-comments.nvim docs
- [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)
NVIM v0.10.0-dev-2980+gb8a2220f5-Homebrew Build type: Release LuaJIT 2.1.0-beta3
Operating system/version
MacOS Ventura 13.4
Describe the bug
You provided a solution to disabling highlighting here. It works however it seems to break:
TodoLocListTodoQuickFixTodoTrouble
It does still work for TodoTelescope though. I don't know if the first 3 use highlight.pattern and Telescope doesn't?
Steps To Reproduce
- Update your config to include the following lines.
local status_ok, todo_comments = pcall(require, "todo-comments")
if not status_ok then
return
end
todo_comments.setup({
signs = false,
highlight = {
-- Disables highlighting. Pattern should never
-- match. Recommendation from plugin author.
-- See issue 168.
pattern = [[xkfiqpd]],
},
})
- Verify that highlighting of your TODOs etc are not overwritten like the plugin normally does.
- Ensure you're in a project that has TODOs and other comments that would normally be tagged.
- Run one of the mentioned commands (
TodoLocList,TodoQuickFix,TodoTrouble) - Verify that your TODOs etc don't show up
Expected Behavior
The expected behavior is for the TODOs to show up in the quickfix list etc.
Repro
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/todo-comments.nvim",
-- add any other plugins here
"nvim-lua/plenary.nvim"
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
local status_ok, todo_comments = pcall(require, "todo-comments")
if not status_ok then
return
end
todo_comments.setup({
signs = false,
highlight = {
pattern = [[xkfiqpd]],
},
})