folke / todo-comments.nvim

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

bug: TODO Comments stopped working #318

Closed garcialn closed 1 week ago

garcialn commented 1 week ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0

Operating system/version

Pop!_OS 22.04 LTS

Describe the bug

I'm using the same config for todo-comments for a while now, but i notice this past week that it has stopped working and i can figure out why and how to solve it... I don't get any error message or anything like that, but the highlights simply are not applied.

Steps To Reproduce

  1. Install the plugin using Lazy
  2. Open a file on nvim (lua, python, rust, go, etc)
  3. Pass the comment+command (eg: -- TODO:)

Expected Behavior

Highlight the word and line according to the config.

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 = {
    signs = true,
    keywords = {
      FIX = {
        icon = ' ',
        color = 'error',
        alt = { 'BUG', 'FIXIT', 'ISSUE' },
      },
      TODO = { icon = ' ', color = 'todo' },
      HINT = { icon = '󰛨 ', color = 'hint' },
      WARN = { icon = ' ', color = 'warning', alt = { 'WARNING', 'XXX' } },
      INFO = { icon = '󰋼 ', color = 'info', alt = { 'NOTE' } },
      TEST = { icon = '󰙨 ', color = 'test', alt = { 'TESTING', 'PASSED', 'FAILED' } },
      PERF = { icon = '󱎫 ', color = 'perf', alt = { 'OPTIM', 'PERFORMANCE', 'OPTIMIZE' } },
      EXAM = { icon = ' ', color = 'exam', alt = { 'WAT', '???' } },
    },
    colors = {
      error = { '#FF204E' }, --'DiagnosticError', 'ErrorMsg',
      todo = { '#EBF400' }, --'Identifier',
      hint = { 'int', '#14C38E' }, --'DiagnosticHint',
      warning = { '#FF5200' }, --'DiagnosticWarn', 'WarningMsg',
      info = { '#1CD6CE' }, --'DiagnosticInfo',
      test = { '#548CFF' }, --'Identifier',
      perf = { '#6F61C0' }, --'Identifier',
      exam = { '#F6E96B' },
    },
  },

} },
    -- add any other plugins here
  },
})
b0ae989c commented 1 week ago

EXAM = { icon = ' ', color = 'exam', alt = { 'WAT', '???' } },

This is a misconfiguration, not a bug. '???' will generate invalid highlight. Remove '???' and you are good.

garcialn commented 1 week ago

Perfect... Did not notice the time correlation between adding that config and the plugin not responding... Tnx ;)