Hi Juri, I have attached a new patch addressing the issues we discussed. I have also changed the name of the new variable a bit, I hope it's a bit more self-explanatory now. I have also tested increasing ‘lazy-highlight-buffer-max-at-a-time’ to 1000. I can't see any loss in responsiveness, except when the old value of 20 also makes the editor freeze (for instance when searching for ".*a.*a$" in very large buffer). This is probably a reasonable default. Best, Augusto