diff --git a/spec/app/window-spec.coffee b/spec/app/window-spec.coffee index 6dcc5bf49..05e582d34 100644 --- a/spec/app/window-spec.coffee +++ b/spec/app/window-spec.coffee @@ -13,7 +13,7 @@ describe "Window", -> describe ".close()", -> it "is triggered by the 'close' event", -> spyOn window, 'close' - $(window).trigger 'close' + $(window).trigger 'core:close' expect(window.close).toHaveBeenCalled() describe ".reload()", -> diff --git a/src/app/keymap.coffee b/src/app/keymap.coffee index eff396131..d88a09041 100644 --- a/src/app/keymap.coffee +++ b/src/app/keymap.coffee @@ -18,6 +18,7 @@ class Keymap 'meta-n': 'new-window' 'meta-,': 'open-user-configuration' 'meta-o': 'open' + 'meta-w': 'core:close' $(document).on 'new-window', => atom.newWindow() $(document).on 'open-user-configuration', => atom.open(atom.configFilePath) diff --git a/src/app/window.coffee b/src/app/window.coffee index 108e305e6..a2484e54a 100644 --- a/src/app/window.coffee +++ b/src/app/window.coffee @@ -24,6 +24,7 @@ windowAdditions = TextMateBundle.loadAll() TextMateTheme.loadAll() @setUpKeymap() + $(window).on 'core:close', => @close() # This method is intended only to be run when starting a normal application # Note: RootView assigns itself on window on initialization so that @@ -34,7 +35,6 @@ windowAdditions = else new RootView(pathToOpen) - $(window).on 'close', => @close() $(@rootViewParentSelector).append(@rootView) $(window).focus() $(window).on 'beforeunload', =>