2017-08-04 50 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); 
相關問題