From bc616d05e7258ea01de25bf6e01e5180e0b36226 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 9 Sep 2011 14:19:56 -0700 Subject: [PATCH] Got rid of the untitled tab. It still gives you an empty editor document. I'd like to get rid of this too and maybe show a "recently opened" window. --- plugins/tabs/tabs.coffee | 9 ++++----- plugins/tabs/tabs.html | 3 +-- src/editor.coffee | 4 +++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/tabs/tabs.coffee b/plugins/tabs/tabs.coffee index 11095f1a0..2301aa3df 100644 --- a/plugins/tabs/tabs.coffee +++ b/plugins/tabs/tabs.coffee @@ -47,7 +47,7 @@ class Tabs extends Pane name = _.last path.split '/' $('#tabs ul .active').removeClass() - $('#tabs ul li:last').after """ + $('#tabs ul').append """
  • #{name}
  • """ $('#tabs ul li:last').addClass 'active' @@ -57,10 +57,9 @@ class Tabs extends Pane nextTab = activeTab.next() nextTab = activeTab.prev() if nextTab.length == 0 - if nextTab.length != 0 - @editor.deleteSession activeTab.data 'path' - activeTab.remove() - @switchToTab nextTab + @editor.deleteSession activeTab.data 'path' + activeTab.remove() + @switchToTab nextTab if nextTab.length != 0 hideTabs: -> $('#tabs').parents('.pane').remove() diff --git a/plugins/tabs/tabs.html b/plugins/tabs/tabs.html index 6b7ddca83..aeaf485d9 100644 --- a/plugins/tabs/tabs.html +++ b/plugins/tabs/tabs.html @@ -1,6 +1,5 @@
    +
    diff --git a/src/editor.coffee b/src/editor.coffee index 734138ea4..e31dbccd0 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -100,8 +100,10 @@ class Editor extends Pane @ace.setSession @sessions[path] deleteSession: (path) -> - @filename = null if path is @filename + if path is @filename + @filename = null delete @sessions[path] + @ace.setSession @newSession() newSession: (code) -> doc = new EditSession code or ''