//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);