 class FileEditorWrapper extends FileEditor
     constructor: (@editor, @filename, @content, @opts) ->
         @init_wrapped(@editor, @filename, @content, @opts)
-        @init_autosave()
 
     init_wrapped: () =>
         # Define @element and @wrapped in derived class
         throw Error('must define in derived class')
 
-    save: () =>
-        @wrapped?.save?()
+    save: (cb) =>
+        if @wrapped?.save?
+            @wrapped.save(cb)
+        else
+            cb?()
 
     has_unsaved_changes: (val) =>
         return @wrapped?.has_unsaved_changes?(val)


        if tab.editor_open()
            # Disconnect from remote session (if relevant), clean up, etc.
            tab.editor().disconnect_from_session?()
            tab.editor().remove?()

        tab.link.remove()
        tab.close_tab?()

        window.smc.editors ?= {}
        window.smc.editors[filename] = editor

        editor.init_autosave()
        return editor

    create_opened_file_tab: (filename) =>
