juanjux / evil-search-highlight-persist

Emacs minor mode to highlight search results in all the buffeer until you clear them or make another, like Vim hlsearch option.
GNU General Public License v2.0
21 stars 11 forks source link

Sometimes it does not turn on #16

Closed hotpxl closed 8 years ago

hotpxl commented 8 years ago

Sometimes (like invoking helm-ag and switch to another buffer on my side), it just turns off. I did some tracing, and found out that after switching to the new buffer, turn-on-search-highlight-persist is called (this is what globalized-minor-mode do). But helm-ag somehow sets the major mode to fundamental-mode. It prevents the plugin from turning on. Then the buffer switches major mode to whatever language I'm in, but it never activates the plugin again.

Is there any way I can work around this?

hotpxl commented 8 years ago

Updated description to match current status..

hotpxl commented 8 years ago

Update:

Seems that after switching to a new buffer, it does call ad-activate. But I have a diff-hl installed. It creates a background fundamental buffer to do some of its work. This buffer is created after the main buffer I'm working with. But on instantiating it ad-deactivate is called and thus globally disabling the advice function.

My question is whether it is possible to activate/deactivate advice functions in a buffer-local fashion.

hotpxl commented 8 years ago

Summary:

diff-hl (or in fact any other plugin) creates a fundamental buffer after the file is opened. evil-search-highlight-persist sees the new buffer and disables the advice function globally.

My suggestion is to make the decision "whether to highlight" buffer local. I'll PR later.

juanjux commented 8 years ago

Thank your for your patch, already merged.