     fileName = "[#{file.vmName}]#{plainPath}"
     return fileName
 
-  saveEditorHistory: ->
-    log "NOT IMPLEMENTED YET"
+  updateEditorStatus:(file, lastSavedContent)->
+    fileName   = FSHelper.plainPath file.path
+    # get current AceViews
+    aceAppView = KD.singletons.appManager.get("Ace").getView()
+    {ace} = aceAppView.aceViews[fileName]
+    ace.lastSavedContents = lastSavedContent
+    unless ace.getContents() is lastSavedContent
+      ace.emit "FileContentChanged"
+    else
+      ace.emit "FileContentSynced"
+
+  removeLocalContents:->
+    for key in @storage.getLocalStorageKeys()
+      if key.indexOf("koding-editor") > -1
+        delete window.localStorage[key]

    @initializeListeners()

  initializeListeners: ->
    status = KD.remote

    @on "LocalContentSynced", (file)->
      log "LocalContentSynced : #{file.path}"

    @on "LocalContentCouldntSynced", (file)->
      log "LocalContentSynced : #{file.path}"

    status.on "reconnected", =>
      return  if @synStarted
      @synStarted = yes
      @syncLocalContentIfDiffExists (err)=>

  removeFromOpenedFiles: (file)->
    fileName = @getFileFullPath file
    index    = @openedFiles.indexOf fileName
    return if index is -1
    @openedFiles.splice index, 1
    @storage.setValue "openedFiles", @openedFiles
    @removeFromSaveArray file
    @removeFileContentFromLocalStorage file

  getRecentOpenedFiles: ->
    @openedFiles
