           title     : "Save and Close"
           callback  : =>
             if file.path.indexOf("localfile:") is 0
-              file.once "fs.saveAs.finished", => @removePane pane
+              file.once "fs.saveAs.finished", => @removePane_ pane
               ace.requestSaveAs()
               modal.destroy()
             else

            modal.destroy()

  closePaneAndModal: (pane, modal) ->
    @removePane pane
    modal.destroy()

class AceApplicationTabView extends ApplicationTabView

  removePane_: KDTabView::removePane

  removePane: (pane) ->
    {ace} = pane.getOptions().aceView
    file  = ace.getData()

    return @removePane_ pane  unless ace.isContentChanged()

    modal = new KDModalView
      cssClass      : "modal-with-text"
      title         : "Do you want to save your changes?"
