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

[meta-issue] Stateful parsing #13

Open
cben opened this issue Oct 29, 2013 · 0 comments
Open

[meta-issue] Stateful parsing #13

cben opened this issue Oct 29, 2013 · 0 comments

Comments

@cben
Copy link
Owner

cben commented Oct 29, 2013

A new approach is needed to support #2, #3 and #12.

Currently I'm hooking change events, clearing all marks in changed area, re-parsing lines using ad-hoc regexp and re-typesetting them.
This is slow, buggy, and re-implements logic CM already has to re-run mode on changes. Ideas (largely stolen from this thread):

  • basic approach: parse by mode + use mode state via getToken.
    make sure re-typesetting is needed iff mode state changed.
  • how to trigger typesetting?
    • on renderLine event, setTimeout to re-typeset any math in the line. Using getToken for context would always be accurate. Problem: flicker!
    • change CM to have tokenParsed event. SLOW?
    • hybrid: cover most stuff from change events, also hook renderLine as fallback (for things like refresh after editing \newcommand).
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

1 participant