我希望该建议仅在我使用Cntrl-Spacebar
时显示。他们的文档有点缺乏。
答案 0 :(得分:2)
您需要设置以下变量:
enableBasicAutocompletion:true
enableLiveAutocompletion:false
仅在按Cntrl - Spacebar
时才能实现自动完成。
选中此代码段进行实时演示:
var langTools = ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: false
});
<html>
<body>
<div id="editor" style="height: 500px; width: 800px">Type in a word like "will" below and press ctrl+space to get "auto completion"</div>
<div id="commandline" style="position: absolute; bottom: 10px; height: 20px; width: 800px;"></div>
</body>
<script src="https://rawgithub.com/ajaxorg/ace-builds/master/src/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="https://rawgithub.com/ajaxorg/ace-builds/master/src/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
</html>