mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Always provide the EditSession and its index on EditSession events
This commit is contained in:
@@ -388,7 +388,7 @@ class Editor extends View
|
||||
if index == -1
|
||||
index = @editSessions.length
|
||||
@editSessions.push(editSession)
|
||||
@trigger 'editor:edit-session-added', editSession
|
||||
@trigger 'editor:edit-session-added', [editSession, index]
|
||||
|
||||
@setActiveEditSessionIndex(index)
|
||||
|
||||
@@ -431,7 +431,7 @@ class Editor extends View
|
||||
@trigger 'editor-path-change'
|
||||
|
||||
@trigger 'editor-path-change'
|
||||
@trigger 'editor:active-edit-session-changed', index
|
||||
@trigger 'editor:active-edit-session-changed', [@activeEditSession, index]
|
||||
@resetDisplay()
|
||||
|
||||
if @attached and @activeEditSession.buffer.isInConflict()
|
||||
|
||||
@@ -3,7 +3,7 @@ _ = require 'underscore'
|
||||
RootView = require 'root-view'
|
||||
Tabs = require 'tabs'
|
||||
|
||||
describe "Tabs", ->
|
||||
fdescribe "Tabs", ->
|
||||
[rootView, editor, statusBar, buffer, tabs] = []
|
||||
|
||||
beforeEach ->
|
||||
|
||||
@@ -23,8 +23,7 @@ class Tabs extends View
|
||||
@addTabForEditSession(editSession)
|
||||
|
||||
@setActiveTab(@editor.getActiveEditSessionIndex())
|
||||
@editor.on 'editor:active-edit-session-changed', (e, index) => @setActiveTab(index)
|
||||
|
||||
@editor.on 'editor:active-edit-session-changed', (e, editSession, index) => @setActiveTab(index)
|
||||
@editor.on 'editor:edit-session-added', (e, editSession) => @addTabForEditSession(editSession)
|
||||
|
||||
addTabForEditSession: (editSession) ->
|
||||
|
||||
Reference in New Issue
Block a user