NbEditorDocument document = (NbEditorDocument) result.getSnapshot().getSource().getDocument(false);
String checktab = result.getSnapshot().getText().toString();
if (checktab.indexOf("\t") >= 0) {
try {
document.remove(0, document.getLength());
document.insertString(0, checktab.replace("\t", " "), null);
} catch (Exception ex) {
}
}
//if cursor was set with temp then this cursor should not be destroyed
if (getLastCurrent() != null && (getLastCurrent().id == ParserTreeConstants.JJTTEMPNODE ||getLastCurrent().id==ParserTreeConstants.JJTLINEBEGIN) ) {