mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
@@ -27,6 +27,8 @@ class StatusBarView extends View
|
||||
@subscribe @pane, 'pane:active-item-changed', =>
|
||||
@subscribeToBuffer()
|
||||
@updatePathText()
|
||||
@subscribe @pane, 'pane:active-item-title-changed', =>
|
||||
@updatePathText()
|
||||
|
||||
@subscribe @pane, 'cursor:moved', => @updateCursorPositionText()
|
||||
@subscribe @grammarName, 'click', => @pane.activeView.trigger 'grammar-selector:show'
|
||||
|
||||
@@ -233,3 +233,14 @@ describe "StatusBar", ->
|
||||
view = $$ -> @div id: 'view', tabindex: -1, 'View'
|
||||
editor.getPane().showItem(view)
|
||||
expect(statusBar.currentPath).toBeHidden()
|
||||
|
||||
describe "when the active item's title changes", ->
|
||||
it "updates the path view with the new title", ->
|
||||
rootView.attachToDom()
|
||||
view = $$ -> @div id: 'view', tabindex: -1, 'View'
|
||||
view.getTitle = => 'View Title'
|
||||
editor.getPane().showItem(view)
|
||||
expect(statusBar.currentPath.text()).toBe 'View Title'
|
||||
view.getTitle = => 'New Title'
|
||||
view.trigger 'title-changed'
|
||||
expect(statusBar.currentPath.text()).toBe 'New Title'
|
||||
|
||||
Reference in New Issue
Block a user