mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Rename root-view: event prefix to window:
This commit is contained in:
@@ -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 " "
|
||||
|
||||
|
||||
@@ -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", ->
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user