final Project project = editor.getProject();
final int indent = indentHelper.getIndent(project, JavaFileType.INSTANCE, node);
final String spaces = IndentHelperImpl.fillIndent(project, JavaFileType.INSTANCE, indent);
final String newText = before + "\n" + spaces + after;
new WriteCommandAction(JavaREPLConsoleExecuteActionHandler.this.project) {
@Override
protected void run(Result result) throws Throwable {
console.setInputText(newText);
caretModel.moveToOffset(offset + indent + 1);
}