From b96692eddfb49ec4b64a5aa4af0103d9a13af1d1 Mon Sep 17 00:00:00 2001 From: Thomas Wilburn Date: Mon, 28 Oct 2013 09:18:43 -0700 Subject: [PATCH] Add autocomplete option. --- config/user.json | 2 ++ js/editor.js | 5 +++++ manifest.json | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config/user.json b/config/user.json index 8d6f79e..82ad260 100644 --- a/config/user.json +++ b/config/user.json @@ -40,6 +40,8 @@ make sure you don't have any syntax errors. //Web workers are used for code hinting in PHP, JavaScript, and JSON. //We don't yet have a way to set the worker options, but you can disable it. "useWorker": true, + //autocomplete triggers on Ctrl-Space + "autocomplete": true, //By default, the palette searches the current file only unless you widen the scope. //If you'd like it to search all open files by default, set this option to true. diff --git a/js/editor.js b/js/editor.js index b95e749..6ea09a5 100644 --- a/js/editor.js +++ b/js/editor.js @@ -35,6 +35,11 @@ define(["file", "command", "settings!ace,user", "dom2"], function(File, command, editor.setShowInvisibles(userConfig.showWhitespace || false); editor.container.style.fontSize = userConfig.fontSize ? userConfig.fontSize + "px" : null; editor.container.style.fontFamily = userConfig.fontFamily || null; + ace.config.loadModule("ace/ext/language_tools", function() { + editor.setOptions({ + enableBasicAutocompletion: userConfig.autocomplete + }); + }); }; command.on("init:startup", init); diff --git a/manifest.json b/manifest.json index 0257754..e070f85 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Caret", "description": "Professional text editing for Chrome and Chrome OS", - "version": "1.1.9", + "version": "1.1.10", "manifest_version": 2, "icons": { "128": "icon-128.png"