         @hideUnsavedNotification()
 
 
-
-
-    @bind "change", => @showUnsavedNotification()
-
-  _setMode: ->
-    @editor.getSession().setMode(@modes[@modeEl.val()])
+    @model.bind "change", => @showUnsavedNotification()
+
 
   setEditorContents: (code) ->
     @editor.getSession().setValue code

    @editor.setShowPrintMargin false
    session = @editor.getSession()
    session.setTabSize(2);
    @_setMode
    @editor.getSession().on "change", => @trigger "change"


    # Hide the line numbering, doesn't work perfectly
    lineNumberWidth = parseInt($(".ace_scroller").css('left'))

    @saveButton.text "Save"

  save: ->
    console.log "sending save #{ document.cookie }"
    @model.save null,
      success: (e) =>
