From c0ee2bed96499ac71ea1266ccb227e9b3581c935 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 21 Oct 2014 15:35:08 -0300 Subject: [PATCH] Closes #127. Increase startup time by using ActivationEvents --- lib/beautify.coffee | 4 ++-- package.json | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/beautify.coffee b/lib/beautify.coffee index 817390372..d00aa4338 100644 --- a/lib/beautify.coffee +++ b/lib/beautify.coffee @@ -9,7 +9,7 @@ languages = beautifier.languages defaultLanguageOptions = beautifier.defaultLanguageOptions # Lazy loaded dependencies fs = null -path = null +path = require("path") strip = null yaml = null LoadingView = null @@ -310,7 +310,7 @@ handleSaveEvent = => return return -Subscriber = require("emissary").Subscriber +{Subscriber} = require path.join(atom.packages.resourcePath, 'node_modules', 'emissary') Subscriber.extend plugin plugin.configDefaults = _.merge( analytics: true diff --git a/package.json b/package.json index 1a58a8564..6e76a2578 100644 --- a/package.json +++ b/package.json @@ -97,5 +97,10 @@ "editorconfig": "^0.11.4", "loophole": "^1.0.0", "typescript-formatter": "~0.1.4" - } + }, + "activationEvents": [ + "beautify", + "core:save", + "core:save-as" + ] }