atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

Make `loaded` an instance variable #259

Closed 50Wliu closed 6 years ago

50Wliu commented 6 years ago

Requirements

Description of the Change

Before, loaded was a global variable. This meant that once it was set to true it would stay true forever, even after deactivating and reactivating snippets. This PR changes it to an instance variable so that its state is reset correctly across activations.

Alternate Designs

None.

Benefits

This makes the bundledSnippetsLoaded method of provideSnippets() much more reliable, as previously it would return the wrong value if snippets was deactivated then reactivated.

Possible Drawbacks

None.

Applicable Issues

Refs atom/settings-view#998, in which I have been experimenting with using bundledSnippetsLoaded.