void (@NotNull VisibleAreaEvent event) { if (!isAutoScrollPreview()) { return; } final Editor editor = event.getEditor(); int y = editor.getScrollingModel().getVerticalScrollOffset(); int currentLine = editor instanceof EditorImpl ? editor.yToVisualLine(y) : y / editor.getLineHeight(); if (currentLine == previousLine) { return; } previousLine = currentLine; ((MarkdownPreviewFileEditor)getPreviewEditor()).scrollToSrcOffset(EditorUtil.getVisualLineEndOffset(editor, currentLine)); }