wolray / symbol-overlay

Highlight symbols with keymap-enabled overlays
346 stars 42 forks source link

Order not respected #35

Open fniessen opened 5 years ago

fniessen commented 5 years ago

Hello, first, thanks for this highlight package that uses overlays, and thus allows to highlight the line, while still being visible!!

Now, just played with it, and the M-n/p key bindings, with common words such as "in" and "if" in a buffer. It's weird, it's skipping some patterns.

(It's good that you can move from one highlight to the next highlighted occurrence, whichever the pattern -- very nice!)

fniessen commented 5 years ago

The title should be "Some patterns are skipped"!

dakra commented 5 years ago

There is a symbol-overlay-ignore-functions variable you probably missed.

From the docstring:

Functions to determine whether a symbol should be ignored.

This is an association list that maps a MAJOR-MODE symbol to a function that determines whether a symbol should be ignored. For instance, such a function could use a major mode's font-lock definitions to prevent a language's keywords from getting highlighted.