   File.write filename, editor.getSession().getValue()
   setMode()
   Chrome.setDirty false
+  editor._emit 'save', { filename }
 exports.open = open = (path) ->
   filename = path
 

      editor.getSession().setValue File.read filename
      setMode()
      Chrome.setDirty false
setMode = ->
  if /\.js$/.test filename
    editor.getSession().setMode new JavaScriptMode


Chrome.addPane 'main', '<div id="editor"></div>'

exports.ace = editor = ace.edit "editor"
editor.setTheme require "ace/theme/twilight"
JavaScriptMode = require("ace/mode/javascript").Mode
CoffeeMode = require("ace/mode/coffee").Mode
