           if contents
             @setContents contents
             @lastSavedContents = contents
+          @editor.on "change", =>
+            if @isContentChanged() then @emit "FileContentChanged" else @emit "FileContentSynced"
           @editor.gotoLine 0
           @focus()
           @show()

        mac   : macKey
      exec    : => callback?()

  ###
  FS REQUESTS
  ###

  requestSave:->

    contents = @getContents()
    return @notify "Nothing to save!" unless contents isnt @lastSavedContents
    @askedForSave = yes
    @emit "ace.requests.save", contents

  requestSaveAs:->

    contents = @getContents()
    @emit "ace.requests.saveAs", contents

  fetchContents:(callback)->

    file = @getData()
    unless /localfile:/.test file.path
      @notify "Loading...", null, null, 10000

      unless err
        @notify "Successfully saved!", "success"
        @lastSavedContents = @lastContentsSentForSave
        @emit "FileContentSynced"
        unless @askedForSave
          log "this file has changed, put a modal and block editing @fatihacet!"
        @askedForSave = no
