void () { if (myVisualColumnToRestore < 0) { EditorUtil.runWithAnimationDisabled(myEditor, () -> myEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE)); return; } VisualPosition position = myCaretModel.getVisualPosition(); if (myVisualColumnToRestore != position.column) { myCaretModel.moveToVisualPosition(new VisualPosition(position.line, myVisualColumnToRestore)); } }