     @firepad.setText content  if @amIHost
     @codeMirrorEditor.scrollTo 0, 0
     @emit "OpenedAFile", file, content
-    @setEditorMode file
+    @setEditorMode file.getExtension()
 
   save: ->
     file        = @getData()

      json             : "javascript"
      js               : "javascript"
      go               : "go"

    if corrections[fileExtension]
      modeName = corrections[fileExtension]

    document.head.appendChild link
    @codeMirrorEditor.setOption "theme", "ambiance"

  setEditorMode:(fileExtension) ->

    return  unless fileExtension

    CodeMirror.modeURL = "#{cdnRoot}/mode/%N/%N.js"
    syntaxHandler      = __aceSettings.syntaxAssociations[fileExtension]
    modeName           = null
    corrections        =
