SublimeText / TrailingSpaces

Highlight trailing spaces and delete them in a flash.
MIT License
897 stars 94 forks source link

Only read file from disk when trim_modified_lines_only is enabled #92

Closed rchl closed 4 years ago

rchl commented 8 years ago

Reading file from disk is an expensive and blocking operation so do it only when option that needs it is enabled.

FichteFoll commented 4 years ago

My issue with this implementation is that you will accumulate watchers for every view ever opened in the current session until their views are closed, while in reality you'd only need to watch the active view. Please make such adjustments that on_deactivated removes views from the watching pipeline.

Also, switching to async hooks would be appropriate.

FichteFoll commented 4 years ago

It appears due to the force-push I mostly reviewd #122 instead of this change. Because that is separate, I'll focus on #122 instead.

Also, this is related to what I said on https://github.com/SublimeText/TrailingSpaces/pull/90.

rchl commented 4 years ago

I've updated PR to only include my change.