void () { if (myCursorUpdater == null) return; myCursorUpdater = null; if (getDocument().getMarkupModel(myProject) == null) return; VisualPosition caretPosition = getCaretModel().getVisualPosition(); Point pos1 = visualPositionToXY(caretPosition); Point pos2 = visualPositionToXY(new VisualPosition(caretPosition.line, caretPosition.column + 1)); myCaretCursor.setPosition(pos1, pos2.x - pos1.x); }