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

        "Ctrl-S"      : @bound "handleSave"

    @setEditorTheme()
    @setEditorMode()

  handleSave: ->
    @save()

    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        =
