Delayed match-highlight causes bad partial reparses #3787

mtaran-google opened this Issue Jan 21, 2016 · 1 comment


None yet

2 participants


Repro steps:

  1. Replace CodeMirror/mode/markdown/index.html with the attached index.html
  2. Open that index.html
  3. Paste in the contents of aaaa.txt (sorry I couldn't make up a small repro case)
  4. In the console run editor.setCursor({line: 485, ch: 28, xRel: 1})

Editor scrolls to the indicated position

Editor scrolls to the indicated position, and then the highlighting gets messed up, flipping code-style and normal-style text. I'm pretty sure this is because of a reparse/redraw that doesn't start very far up above the upper edge of the viewport.

@marijnh marijnh closed this in 933aedc Jan 24, 2016
marijnh commented Jan 24, 2016

The mode was, for some reason, keeping state in a variable rather than in its state object, and this kind of corruptions in rare situation are exactly what that causes. Attached patch fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment