skuroda / PersistentRegexHighlight

Persistent regular expression highlighting for Sublime Text 2
MIT License
53 stars 9 forks source link

Feature Request -- Refresh highlights "on save" #19

Open IntoCpp opened 8 years ago

IntoCpp commented 8 years ago

First, this plug-in is the sole reason I use Sublime. Every IDE needs his.

I work on large projects with very large files. When I enable the "on_modify": true, the Sublime slows to a crawl. 0.5 to 5 seconds between a type and it showing on screen.

No point in disabling for large file, I might as well not use it at all. Disabling the "on_modify" also mean re-loading the file every few minutes; annoying.

A great option would be a refresh only on file save; with I do already often enough.

So we would get a set of options like:

"enabled": true, "on_load": true, "on_save": true, "on_modify": false, "max_file_size": 0,

As an alternate solution; an optimization of only refreshing the text area that just changed; I assume the entire file (files?) are re-scan every time a key is stroked. But I do not know if this is at all possible.

Thanks for the great tool;

I.C.

skuroda commented 8 years ago

Thanks for making the feature request. I have been meaning to go look at making this run faster by perhaps limiting it to the visible region or similar. In any case, the on_save is a great idea. This previously wasn't possible using the ST2 API, but believe it now is in ST3. Can't make any promises in terms of timeline, but definitely "on the radar" now.