Oh no, we can't set the title in the constructor because window hasn't been required yet!

This commit is contained in:
Corey Johnson
2011-11-10 17:22:33 -08:00
parent 930a5ff5c7
commit 4dc2d2fca1

View File

@@ -76,6 +76,9 @@ class Editor extends Document
catch e
null
title: ->
if @path then _.last @path.split '/' or 'untitled'
open: (path) ->
return false if not super
return false if @path
@@ -86,6 +89,9 @@ class Editor extends Document
@ace.getSession().setUndoManager new UndoManager
mode = @modeForPath()
@ace.getSession().setMode new mode if mode
window.setTitle @title()
true
close: ->