SublimeText / TrailingSpaces

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

If file could not be accessed on disk, ignore trim_modified_lines_only setting #72

Closed rahul-ramadas closed 10 years ago

rahul-ramadas commented 10 years ago

Occasionally, TrailingSpaces throws an exceptions in the codecs.open function. The most common case is when you are editing a file that was opened from within a .sublime-package file, like, for instance, your default key bindings file. It doesn't really have a major impact, but I like to keep my console free of exceptions from plugins. This change should fix it. The only caveat is that, for such views, the trim_modified_lines_only setting will be ignored, simply because there doesn't seem to be a good way to take a snapshot of the view.

Also added a minor optimization wherein a snapshot of the file is not taken unless trim_modified_lines_only is set.

rahul-ramadas commented 10 years ago

This should fix #57 and #62.