去除中間的豎線:editor.renderer.setShowGutter(false);
去除行號: editor.setShowPrintMargin(false);
設置並獲取內容:
editor.setValue("the new text here");
editor.session.setValue("the new text here"); // set value and reset undo history
editor.getValue(); // or session.getValue
設置主題: editor.setTheme("ace/theme/xcode");
設置語言模式: editor.session.setMode("ace/mode/sql");
啓用提示菜單:
ace.require("ace/ext/language_tools");
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true
});
撤銷:editor.undo();
重做回退:editor.redo();
光標跳轉到指定行:editor.gotoLine();
查找替換:editor.execCommand('replace');
自動換行:editor.setOption("wrap", "free"); //關閉時free換成off