New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed match-highlight causes bad partial reparses #3787

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

Comments

Projects
None yet
2 participants
@mtaran-google
Contributor

mtaran-google commented Jan 21, 2016

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})

Expected:
Editor scrolls to the indicated position

Actual:
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.

repro.zip

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

@marijnh

This comment has been minimized.

Show comment
Hide comment
@marijnh

marijnh Jan 24, 2016

Member

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.

Member

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