Skip to content
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
Closed

Delayed match-highlight causes bad partial reparses #3787

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

Comments

@mtaran-google
Copy link
Contributor

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
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants