Lines are shifted when scrolling when a caret is on a line with a different font size

Lines are shifted when scrolling when a caret is on a line with a different font size.
Then select other line and they will be displayed correctly.

cm-scroll

The following code reproduces it:

import { basicSetup, EditorView } from '@codemirror/basic-setup';
import { EditorState } from '@codemirror/state';
import { markdown } from '@codemirror/lang-markdown';
import { tags, HighlightStyle } from '@codemirror/highlight';

const myHighlightStyle = HighlightStyle.define([
  { tag: tags.heading1, fontSize: '2.5em' },
]);

const doc = '# 1\n' + [...Array(999)].map((v, i) => i + 2).join('\n');

const state = EditorState.create({
  doc,
  extensions: [
    basicSetup,
    markdown(),
    myHighlightStyle,
  ]
})

const view = new EditorView({
  state,
  parent: document.body
});

Is this a problem with my usage? Or is it a bug?

That was a bug. I have a patch for it, which I’ll release as part of the upcoming 0.20.0 version.

Thanks for the reply.