void () { // Inspired by IDEA-76353. The point is that we need to consider cached information about tab symbols width during logical // position to offset mapping String text = "\t test"; init(15, text); ((EditorImpl)getEditor()).setPrefixTextAndAttributes(" ", new TextAttributes()); getEditor().getCaretModel().moveToOffset(text.length()); }