diff --git a/src/extensions/tabs/spec/tabs-spec.coffee b/src/extensions/tabs/spec/tabs-spec.coffee index 9a873c1e9..385dbed25 100644 --- a/src/extensions/tabs/spec/tabs-spec.coffee +++ b/src/extensions/tabs/spec/tabs-spec.coffee @@ -18,7 +18,7 @@ describe "Tabs", -> rootView.remove() describe "@activate", -> - fit "appends a status bear to all existing and new editors", -> + it "appends a status bear to all existing and new editors", -> expect(rootView.panes.find('.pane').length).toBe 1 expect(rootView.panes.find('.pane > .tabs').length).toBe 1 editor.splitRight() @@ -26,9 +26,13 @@ describe "Tabs", -> expect(rootView.panes.find('.pane > .tabs').length).toBe 2 describe "#initialize()", -> - fit "creates a tab for each edit session on the editor to which the tab-strip belongs", -> + it "creates a tab for each edit session on the editor to which the tab-strip belongs", -> expect(editor.editSessions.length).toBe 2 expect(tabs.find('.tab').length).toBe 2 expect(tabs.find('.tab:eq(0) .file-name').text()).toBe editor.editSessions[0].buffer.getBaseName() expect(tabs.find('.tab:eq(1) .file-name').text()).toBe editor.editSessions[1].buffer.getBaseName() + + it "highlights the tab for the current active edit session", -> + expect(editor.getActiveEditSessionIndex()).toBe 1 + expect(tabs.find('.tab:eq(1)')).toHaveClass 'active' diff --git a/src/extensions/tabs/src/tabs.coffee b/src/extensions/tabs/src/tabs.coffee index abbc06ad9..39eeddf27 100644 --- a/src/extensions/tabs/src/tabs.coffee +++ b/src/extensions/tabs/src/tabs.coffee @@ -19,7 +19,10 @@ class Tabs extends View @div class: 'tabs' initialize: (@editor) -> - for editSession in @editor.editSessions + for editSession, index in @editor.editSessions @append $$ -> @div class: 'tab', => @div editSession.buffer.getBaseName(), class: 'file-name' + + activeIndex = @editor.getActiveEditSessionIndex() + @children(":eq(#{activeIndex})").addClass('active') diff --git a/src/extensions/tabs/src/tabs.css b/src/extensions/tabs/src/tabs.css index fb8c5f0d8..17d56ea43 100644 --- a/src/extensions/tabs/src/tabs.css +++ b/src/extensions/tabs/src/tabs.css @@ -9,12 +9,17 @@ margin-bottom: 0; margin-right: 0; padding: 4px; - background: #555; + background: #3a3a3a; color: white; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; } + +.tab.active { + background: #555; +} + .tab:last-child { margin-right: 4px; } \ No newline at end of file