wolray / symbol-overlay

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

Add an option to not add the post command hook function #77

Closed mattbeshara closed 3 years ago

mattbeshara commented 3 years ago

Hi again, This is another patch which can improve performance. I've found that disabling the post command hook improves the speed at which point moves through a buffer. Not enabling that hook function isn't without side effects, though the only downside I can see is that the temporary symbol highlight stays in place after point moves off of the current symbol, until it moves onto another symbol. I've made this PR as I think others might also find this useful.

Thanks, Matt

purcell commented 3 years ago

Thanks!

the only downside I can see is that the temporary symbol highlight stays in place after point moves off of the current symbol

I feel like this one is quite a significant compromise that I'm not sure is worthwhile.

mattbeshara commented 3 years ago

Fair enough, I'll close this PR then. I've had a quick look at the post command hook and it seems likely it could be made more efficient, but I haven't written any code to that effect yet. If I do at some point I'll open another PR. Thanks!