Skip to content

[meta-issue] Stateful parsing #13

@cben

Description

@cben

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions