enable autocompletion and snippets

This commit is contained in:
nightwing 2013-07-18 20:19:17 +04:00
commit 8a22cf4873
2 changed files with 24 additions and 1 deletions

View file

@ -112,7 +112,7 @@ Or using Node.JS
The editor can then be opened at http://localhost:8888/kitchen-sink.html.
To open the editor with a file:/// URL see [the wiki](https://github.com/ajaxorg/ace/wiki/Running-Ace-from-a-file:).
To open the editor with a file:/// URL see [the wiki](https://github.com/ajaxorg/ace/wiki/Running-Ace-from-file).
Building Ace
-----------

View file

@ -9,6 +9,29 @@ $(function() {
editor.session.setMode("ace/mode/javascript");
editor.session.setMode("ace/mode/javascript");
embedded_editor.session.setMode("ace/mode/html");
ace.config.loadModule("ace/ext/emmet", function() {
ace.require("ace/lib/net").loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() {
embedded_editor.setOption("enableEmmet", true);
editor.setOption("enableEmmet", true);
});
embedded_editor.setOptions({
enableSnippets: true,
enableBasicAutocompletion: true
});
});
ace.config.loadModule("ace/ext/language_tools", function() {
embedded_editor.setOptions({
enableSnippets: true,
enableBasicAutocompletion: true
});
editor.setOptions({
enableSnippets: true,
enableBasicAutocompletion: true
});
});
embedded_editor.setAutoScrollEditorIntoView(true);
editor.setAutoScrollEditorIntoView(true);