quick-scope
quick-scope copied to clipboard
Disable on comments
Would it be possible to disable highlighting on commented lines?
:help matchadd
Syntax highlighting (see 'syntax') is a separate mechanism, and regardless of the chosen priority a match will always overrule syntax highlighting.
I can't think of a great workaround without autocommands to matchadd comments for every filetype.
I don't think we'd need matchadd, we simply need to shortcircuit the function that adds the QuickScope highlights quick_scope#HighlightLine() seems like a good candidate. We would need a way to determine if the current line is within a comment.
We might be able to make use of :help comments
or :help commentstring
to detect if the current line is a comment, but I'm not exactly sure what that would look like right now.
apply_highlight_patterns
uses matchadd
, I'd meant we can't simply set the comment highlight group to a higher priority - we have to prevent highlighting them in the first place or matchadd
comments back to how they should be.
Oh, I understand. Yes, you are correct.