From 7b42fc260c8540321c5dcd19b23079ce417ce64c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 3 Jan 2014 15:10:11 +0000 Subject: [PATCH] feature(edit) add autocomletion --- lib/client/edit.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/client/edit.js b/lib/client/edit.js index cf5744cf..cc02ca9b 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -57,9 +57,6 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch; initAce(); } - if (!Modelist) - Modelist = ace.require('ace/ext/modelist'); - if (isDir) lMode = Modelist.modesByName.json.mode; else @@ -151,6 +148,14 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch; bindKey : { win: 'Ctrl-S', mac: 'Command-S' }, exec : save }); + + ace.require('ace/ext/language_tools'); + Modelist = ace.require('ace/ext/modelist'); + + Ace.setOptions({ + enableBasicAutocompletion : true, + enableSnippets : true + }); } function save () {