SublimeText / TrailingSpaces

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

Wrong old descriptor file when using MLO #40

Closed chikamichi closed 11 years ago

chikamichi commented 11 years ago

While investigating #39, I realized that when switching tabs/opening a new file/whatever changes the view, the old file descriptor (coming from the cached on_disk value) used for comparing versions is messed up: it describes the first opened file, not the currently active view. This results in all trailing spaces being deleted, defeating the very purpose of the MLO setting.

The on_disk cache should be overwritten when hitting the on_activated hook, so that the proper, active file is considered. This may be an issue when switching back and forth between files though (we don't want to erase a valid old/on_disk descriptor. Maintaining an array of descriptors under the on_load hook may then be smarter. Plus, populating the cache if no matching descriptor for the current, active view is found at diff time.

chikamichi commented 11 years ago

As of build #3021 it is fixed (code was already doing the right thing).