From 9303aaa8fdffb1e0752b6170ad17d34b51fa1277 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Fri, 19 Oct 2012 12:51:36 -0600 Subject: [PATCH] Rename `root-view:` event prefix to `window:` --- spec/app/root-view-spec.coffee | 12 ++++++------ spec/extensions/wrap-guide-spec.coffee | 2 +- src/app/keymaps/atom.coffee | 8 ++++---- src/app/root-view.coffee | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/app/root-view-spec.coffee b/spec/app/root-view-spec.coffee index 31e612115..2dad371c3 100644 --- a/spec/app/root-view-spec.coffee +++ b/spec/app/root-view-spec.coffee @@ -542,13 +542,13 @@ describe "RootView", -> describe "font size adjustment", -> it "increases/decreases font size when increase/decrease-font-size events are triggered", -> fontSizeBefore = rootView.getFontSize() - rootView.trigger 'root-view:increase-font-size' + rootView.trigger 'window:increase-font-size' expect(rootView.getFontSize()).toBe fontSizeBefore + 1 - rootView.trigger 'root-view:increase-font-size' + rootView.trigger 'window:increase-font-size' expect(rootView.getFontSize()).toBe fontSizeBefore + 2 - rootView.trigger 'root-view:decrease-font-size' + rootView.trigger 'window:decrease-font-size' expect(rootView.getFontSize()).toBe fontSizeBefore + 1 - rootView.trigger 'root-view:decrease-font-size' + rootView.trigger 'window:decrease-font-size' expect(rootView.getFontSize()).toBe fontSizeBefore it "does not allow the font size to be less than 1", -> @@ -701,14 +701,14 @@ describe "RootView", -> expect(rightEditor.find(".line:first").text()).toBe " " expect(leftEditor.find(".line:first").text()).toBe " " - rootView.trigger "root-view:toggle-invisibles" + rootView.trigger "window:toggle-invisibles" expect(rightEditor.find(".line:first").text()).toBe "•▸ •¬" expect(leftEditor.find(".line:first").text()).toBe "•▸ •¬" lowerLeftEditor = leftEditor.splitDown() expect(lowerLeftEditor.find(".line:first").text()).toBe "•▸ •¬" - rootView.trigger "root-view:toggle-invisibles" + rootView.trigger "window:toggle-invisibles" expect(rightEditor.find(".line:first").text()).toBe " " expect(leftEditor.find(".line:first").text()).toBe " " diff --git a/spec/extensions/wrap-guide-spec.coffee b/spec/extensions/wrap-guide-spec.coffee index 0aa024cdb..f6123789c 100644 --- a/spec/extensions/wrap-guide-spec.coffee +++ b/spec/extensions/wrap-guide-spec.coffee @@ -32,7 +32,7 @@ describe "WrapGuide", -> it "updates the wrap guide position", -> initial = wrapGuide.position().left expect(initial).toBeGreaterThan(0) - rootView.trigger('root-view:increase-font-size') + rootView.trigger('window:increase-font-size') expect(wrapGuide.position().left).toBeGreaterThan(initial) describe "overriding getGuideColumn", -> diff --git a/src/app/keymaps/atom.coffee b/src/app/keymaps/atom.coffee index 4ad888c02..80886a1a9 100644 --- a/src/app/keymaps/atom.coffee +++ b/src/app/keymaps/atom.coffee @@ -21,7 +21,7 @@ window.keymap.bindKeys 'body' pageup: 'core:page-up' pagedown: 'core:page-down' - 'meta-S': 'root-view:save-all' - 'meta-+': 'root-view:increase-font-size' - 'meta--': 'root-view:decrease-font-size' - 'ctrl-w w': 'root-view:focus-next-pane' + 'meta-S': 'window:save-all' + 'meta-+': 'window:increase-font-size' + 'meta--': 'window:decrease-font-size' + 'ctrl-w w': 'window:focus-next-pane' diff --git a/src/app/root-view.coffee b/src/app/root-view.coffee index 6a8162eb5..7e0915221 100644 --- a/src/app/root-view.coffee +++ b/src/app/root-view.coffee @@ -74,11 +74,11 @@ class RootView extends View @project.setPath(path) unless @project.getRootDirectory() @setTitle(path) - @command 'root-view:increase-font-size', => @setFontSize(@getFontSize() + 1) - @command 'root-view:decrease-font-size', => @setFontSize(@getFontSize() - 1) - @command 'root-view:focus-next-pane', => @focusNextPane() - @command 'root-view:save-all', => @saveAll() - @command 'root-view:toggle-invisibles', => @setShowInvisibles(not @showInvisibles) + @command 'window:increase-font-size', => @setFontSize(@getFontSize() + 1) + @command 'window:decrease-font-size', => @setFontSize(@getFontSize() - 1) + @command 'window:focus-next-pane', => @focusNextPane() + @command 'window:save-all', => @saveAll() + @command 'window:toggle-invisibles', => @setShowInvisibles(not @showInvisibles) afterAttach: (onDom) -> @focus() if onDom