mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Don't track closed sessions with no path
This commit is contained in:
@@ -156,6 +156,9 @@ describe "Editor", ->
|
||||
editSession = editor.activeEditSession
|
||||
expect(editor.closedEditSessions.length).toBe 0
|
||||
editor.trigger "core:close"
|
||||
expect(editor.closedEditSessions.length).toBe 0
|
||||
editor.edit(rootView.project.buildEditSessionForPath(rootView.project.resolve('sample.txt')))
|
||||
editor.trigger "core:close"
|
||||
expect(editor.closedEditSessions.length).toBe 1
|
||||
|
||||
it "closes the active edit session and loads next edit session", ->
|
||||
|
||||
@@ -492,7 +492,7 @@ class Editor extends View
|
||||
editSession = @editSessions[index]
|
||||
destroySession = =>
|
||||
path = editSession.getPath()
|
||||
@closedEditSessions.push({path, index})
|
||||
@closedEditSessions.push({path, index}) if path
|
||||
editSession.destroy()
|
||||
callback?(index)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user