因此,您可以使用setValue
设置ace编辑器的值,但在设置值之后,编辑器将选择编辑器的整个值。如何禁用此功能?这意味着当我将ace编辑器的值设置为Hello world
时,它不会突出显示Hello world
发布于 2013-09-05 14:28:19
可以使用第二个参数来控制setValue之后的光标位置
editor.setValue(str, -1) // moves cursor to the start
editor.setValue(str, 1) // moves cursor to the end
发布于 2017-02-06 16:54:52
您甚至可以在执行setValue()之后使用clearSelection();
editor.setValue("Hello World");
editor.clearSelection(); // This will remove the highlight over the text
发布于 2013-12-19 15:40:52
这对我来说很有效!
editor.setValue(editor.getValue(), 1);
https://stackoverflow.com/questions/18614169
复制相似问题