todo-comments.nvim icon indicating copy to clipboard operation
todo-comments.nvim copied to clipboard

bug: Weird keyword highlighting without treesitter parser

Open Lun4m opened this issue 4 months ago • 1 comments

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: Screenshot from 2024-10-09 12-28-48

In a toml file: Screenshot from 2024-10-09 12-30-06

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

  1. echo $'-- TODO: todo\n-- FIXME: fixme\n-- NOTE: note' > test.lua
  2. echo $'# TODO: todo\n# FIXME: fixme\n# NOTE: note' > test.toml
  3. nvim -u repro.lua test.lua → comments are greyed out for some reason
  4. :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" } },
    },
  },
})

Lun4m avatar Oct 09 '24 12:10 Lun4m