2017-08-04 45 views

回答

0

这样做的一种方法是,存储当前光标位置,插入数据并将光标位置设置为初始点。

//Get the Current Positon 
var currentPosition = editor.selection.getCursor(); 

//Insert data into the editor 
editor.setValue(data); 
editor.clearSelection(); 

//Set the cursor to the Initial Point 
editor.gotoLine(currentPosition.row, currentPosition.column); 
相关问题