@Override
    public void visibleAreaChanged(@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)myPreview).scrollToSrcOffset(EditorUtil.getVisualLineEndOffset(editor, currentLine));
    }
@Override
    public void visibleAreaChanged(@NotNull VisibleAreaEvent event)