wolray / symbol-overlay

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

Support not putting boundaries on match #69

Closed MicahElliott closed 3 years ago

MicahElliott commented 3 years ago

Would be nice if, eg, point is on foo and symbol-overlay-put is called and it's able to also match foo-bar in same group.

Not sure if it's also useful to exclude a head/beginning boundary. Actually, it probably is for things like clojure keys that you want to match to a similarly named function. So :some-fn is matched when point is on some-fn.

purcell commented 3 years ago

The general case of this is wanting to configure how symbols are turned into regexes, which is currently done by symbol-overlay-regexp. I could see how if this were delegated to a configuration symbol-overlay-regexp-function that might be a useful extension point in certain major modes. Note, though, that changing the way this matches would likely break functionality like symbol-overlay-rename, so for that reason I'm not in favour of pursuing this.

MicahElliott commented 3 years ago

@purcell Given your solution to https://github.com/wolray/symbol-overlay/issues/70 , this feels less important now, since it's easy enough to turn an overlay into a flexible custom search. Thank you again!