【发布时间】:2015-05-26 01:35:33
【问题描述】:
我想在 ACE 中选择第 2 行进行复制和粘贴。有一个方法selectLine(),记录在这里:http://ace.c9.io/#nav=api&api=selection,但我不明白如何使用它。不幸的是,在 stackoverflow.com 上也找不到关于选择的内容,只有关于突出显示的内容,这是不一样的。
// ACE Editor Setup
var editor = ace.edit("editor");
editor.setTheme("ace/theme/crimson_editor");
editor.getSession().setMode("ace/mode/html");
editor.setValue("textline1\n textline2\n textline3");
var select = new Selection(editor.getSession()); // Uncaught TypeError: Illegal constructor
select.selectLine(2);
【问题讨论】:
标签: javascript ace-editor