int (@NotNull final Editor editor) { final JComponent header = editor.getHeaderComponent(); int headerOffset = header == null ? 0 : header.getHeight(); return -editor.getScrollingModel().getVerticalScrollOffset() + headerOffset; }