       [node] = finderController.treeController.selectedNodes
       name   = input.getValue()
 
-      return @ace.notify "Please type valid file name!"   , "error"  unless FSHelper.isValidFileName name
-      return @ace.notify "Please select a folder to save!", "error"  unless node
+      return @ace.notify 'Please type valid file name!'   , 'error'  unless FSHelper.isValidFileName name
+      return @ace.notify 'Please select a folder to save!', 'error'  unless node
 
       dialog.destroy()
       # @utils.wait 300, => # temp fix to be sure overlay has removed with fade out animation
 
       parent = node.getData()
-      file.emit "file.requests.saveAs", @ace.getContents(), name, parent.path
-      file.once "fs.saveAs.finished",   @ace.bound "saveAsFinished"
-      @ace.emit "AceDidSaveAs", name, parent.path
+      file.emit 'file.requests.saveAs', @ace.getContents(), name, parent.path
+      file.once 'fs.saveAs.finished',   @ace.bound 'saveAsFinished'
+      @ace.emit 'AceDidSaveAs', name, parent.path
       oldCursorPosition = @ace.editor.getCursorPosition()
-      file.on "fs.saveAs.finished", =>
+      file.on 'fs.saveAs.finished', =>
         {tabView} = @getDelegate()
         return  if tabView.willClose
         @getDelegate().openFile FSHelper.createFileFromPath "#{parent.path}/#{name}", yes

    else
      @findAndReplaceView = new KDCustomHTMLView

    @setViewListeners()

  setViewListeners:->
    @ace.on "ace.changeSetting", (setting, value)=>
      @ace["set#{setting.capitalize()}"]? value

    @ace.on "ace.requests.saveAs", (contents, options)=>
      @openSaveDialog options

    @ace.on "ace.requests.save", (contents)=>
      file = @getData()
      if /localfile:/.test file.path
        @openSaveDialog closeAfter: no
      else
        file.once "fs.save.started",    @ace.bound "saveStarted"
        file.once "fs.save.finished",   @ace.bound "saveFinished"
        file.emit "file.requests.save", contents

    @ace.on "FileContentChanged", =>
      @ace.contentChanged = yes
      @getActiveTabHandle().setClass "modified"
      @getDelegate().quitOptions =
        message : "You have unsaved changes. You will lose them if you close this tab."
        title   : "Do you want to close this tab?"

    @ace.on "FileContentSynced", =>
      @ace.contentChanged = no
      @getActiveTabHandle().unsetClass "modified"
      delete @getDelegate().quitOptions

    @on 'KDObjectWillBeDestroyed', =>

    return  @getDelegate().tabView.getActivePane().tabHandle

  toggleFullscreen: ->
    mainView = KD.getSingleton 'mainView'
    mainView.toggleFullscreen()

  getAdvancedSettingsMenuItems:->
    settings      :
      type        : 'customView'
      view        : new AceSettingsView
        delegate  : @ace

  getSaveMenu:->
    'Save as...' :
      id         : 13
      parentId   : null
      callback   : =>
