folke / todo-comments.nvim

✅ Highlight, list and search todo comments in your projects
Apache License 2.0
2.97k stars 86 forks source link

bug: Disabling highlighting breaks some integrations #212

Closed TJ-Adams closed 1 week ago

TJ-Adams commented 1 year ago

Did you check docs and existing issues?

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:

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

  1. 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]],
    },
})
  1. Verify that highlighting of your TODOs etc are not overwritten like the plugin normally does.
  2. Ensure you're in a project that has TODOs and other comments that would normally be tagged.
  3. Run one of the mentioned commands (TodoLocList, TodoQuickFix, TodoTrouble)
  4. 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]],
    },
})
github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 week ago

This issue was closed because it has been stalled for 7 days with no activity.