jueves, 11 de febrero de 2016

With this trick, Helm-dash gets find-as-you-type for free, developers hate it...

It's been a long time since I had this feature in mind. Where helm-dash would open documentation pages as you typed. 

It is clearly possible to run actions while pressing keys (helm-swoop does it). But when I looked at its code, I saw the author had rewritten and rebound most of the keys to add the 'hooks'. I clearly didn't want to do that.  

So I kept looking for cleaner solutions (helm-dash didn't have to do complex things, just trigger the action at every keypress), and wrote my finding in this issue. hooking to helm-idle, or hooking to 'helm-after-update-hook seemed the sanest options, but none was compelling enough.

Then I learned that you can set a 'persistent-action', that will run when you press c-z and won't quit helm. Ok, that's something. Not exactly what I ment but I can live with it.

FastForward a year , and while I was using helm-dash, I spotted the hints in the modeline.


So after c-h m, I discovered that c-c c-f does exactly what I want, that is running the persistent-action on every keypress.


So yeah, standing on the shoulders of giants, in this case I got my feature without needing to code a single line.

Issue closed!

No hay comentarios: