 
   setOpenRecentFiles:(value, save = yes)->
     @appStorage.setValue 'openRecentFiles', value
+
+  setEnableAutocomplete:(value, save = yes)->
+
+    requirejs ['ace/ext-language_tools'], =>
+      @editor.setOptions
+        enableBasicAutocompletion: value
+        enableSnippets: value
+    return  unless save
+    @appStorage.setValue 'enableAutocomplete', value
 
   gotoLine: (lineNumber) ->
     @editor.gotoLine lineNumber

      @setKeyboardHandler     @appStorage.getValue('keyboardHandler')     ? 'default'
      @setScrollPastEnd       @appStorage.getValue('scrollPastEnd')       ? yes
      @setOpenRecentFiles     @appStorage.getValue('openRecentFiles')     ? yes

    requirejs ['ace/ext-language_tools'], =>
      @editor.setOptions
        enableBasicAutocompletion: yes
        enableSnippets: yes

  saveStarted:->
    @lastContentsSentForSave = @getContents()

  getOpenRecentFiles:->
    @appStorage.getValue('openRecentFiles') ? yes

  getEnableAutocomplete:->
    @appStorage.getValue('enableAutocomplete') ? yes

  getSettings:->
    theme               : @getTheme()
    syntax              : @getSyntax()
