Closed RRethy closed 5 years ago
Neither solution fixes all edge cases.
A possible alternate solution would be to avoid using \k
in the matching regex and instead use something more custom to only match letters/numbers and no punctuation. Will need to measure performance impact however.
Hovering over
foo
will not highlight the other instance of foo for most people. This is due to the defaultiskeyword
option for C/C++ files. Ideally, it would highlight it.A simple fix would be to fix this specific use case, but it could arise for other cases I haven't observed. It might be nice to be able define a regex pattern to highlight, similar to how hl-groups are currently used. For example,
Let's say the
foo
is hovered over, then it would highlightfoo
andfoo-
but not highlight the-
in the second one.Another solution would be to have a list of temporary modifications to
iskeyword
, for example,Then when matching is done,
iskeyword
would be modified, and then restored after highlighting. This second option might not work and isn't very flexible.