Is there a config to have # KEYWORD(username):?
#334
Replies: 2 comments 1 reply
-
|
Hi, I came across this problem and unfortunately it seems that Vim regex has some issues that prevent the ? quantifier from working properly. I've tried @galenseilis answer, but it failed to match TODO with parentheses. I also tried a few other approaches but wasn’t lucky either, so I ended up doing this instead: highlight = {
pattern = {
[[.*<(KEYWORDS)\s*:]], -- TODO: this matches
[[.*<(KEYWORDS)\s*\(\w*\)\s*:]], -- TODO(author): this also matches
},
},
search = { pattern = [[\b(TODO)\s*(\(\w*\))?\s*:]] },Fortunately, the rg regex works fine — hope this helps anyone running into the same issue! |
Beta Was this translation helpful? Give feedback.
-
|
I also ran into this problem, and tried the patterns from both @galenseilis and @inkfin. Inkfin's pattern list got me close, but didn't highlight the entire I ended up settling on this pattern that both correctly highlights and correctly populates the quickfix list:
The key difference here is wrapping an additional capture group around both the See here: todo-comments.nvim/lua/todo-comments/highlight.lua Lines 50 to 56 in 19d461d So, for the capturing part of the pattern -
The following table illustrates the outcome:
|
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
-
I am excited about #332! It should go well with Ruff's TD002.
In the mean time, is there currently a way to support this in config?
I made an attempt, but in retrospect I see that trying to update the REGEX is insufficient. I expect I am missing things specifying the allowed patterns and what colour they should get...
Beta Was this translation helpful? Give feedback.
All reactions