From d234c8fdce0049875b406171020749706e506594 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 12 Feb 2013 11:20:21 -0800 Subject: [PATCH] Don't track closed sessions with no path --- spec/app/editor-spec.coffee | 3 +++ src/app/editor.coffee | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 66587f2fb..30c8a0ee2 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -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", -> diff --git a/src/app/editor.coffee b/src/app/editor.coffee index d5de08a88..1a69ef280 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -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)