Trying to match word repetition, an issue with match overlap? #2105
-
Contributing guidelines
Module(s)mini.hipatterns QuestionHello! Second, I want to highlight any number of repetition of I tried using patterns like this: {
-- e.g. TODO_TODO_TODO_something
"()TODO_()TODO_", -- a _TODO_ followed by (at least) another _TODO_
"TODO_()TODO()_[^T][^O]", -- the final _TODO_ of the chain (NOT followed by another _TODO_)
},But I'm only getting this: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 15 replies
-
|
Beta Was this translation helpful? Give feedback.
-
The core reason for the expectation mismatch is indeed how several pattern matches on a single line is done. The current approach works like this:
This is how Neovim's search (like with What would make this use case work with a single In theory, this is a very trivial change of I'll take a closer look at what is the best compromise here. An alternative approach is to keep looking fro the right of the real match. At least it makes it work with the patterns in the original comment. |
Beta Was this translation helpful? Give feedback.
-
|
This should now be resolved on latest |
Beta Was this translation helpful? Give feedback.

This should now be resolved on latest
main. The patterns from the original comment should work now, as described in this note.