mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add 'editor:active-edit-session-changed' events to Editor
This commit is contained in:
@@ -277,6 +277,19 @@ describe "Editor", ->
|
||||
runs ->
|
||||
expect(atom.confirm).toHaveBeenCalled()
|
||||
|
||||
it "emits an editor:active-edit-session-changed event with the edit session and its index", ->
|
||||
activeEditSessionChangeHandler = jasmine.createSpy('activeEditSessionChangeHandler')
|
||||
editor.on 'editor:active-edit-session-changed', activeEditSessionChangeHandler
|
||||
|
||||
editor.setActiveEditSessionIndex(2)
|
||||
expect(activeEditSessionChangeHandler).toHaveBeenCalled()
|
||||
expect(activeEditSessionChangeHandler.argsForCall[0][1]).toBe 2
|
||||
activeEditSessionChangeHandler.reset()
|
||||
|
||||
editor.setActiveEditSessionIndex(0)
|
||||
expect(activeEditSessionChangeHandler.argsForCall[0][1]).toBe 0
|
||||
activeEditSessionChangeHandler.reset()
|
||||
|
||||
describe ".loadNextEditSession()", ->
|
||||
it "loads the next editor state and wraps to beginning when end is reached", ->
|
||||
expect(editor.activeEditSession).toBe session2
|
||||
|
||||
@@ -430,6 +430,7 @@ class Editor extends View
|
||||
@trigger 'editor-path-change'
|
||||
|
||||
@trigger 'editor-path-change'
|
||||
@trigger 'editor:active-edit-session-changed', index
|
||||
@resetDisplay()
|
||||
|
||||
if @attached and @activeEditSession.buffer.isInConflict()
|
||||
|
||||
Reference in New Issue
Block a user