-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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.- e.g. for Update math style when context changes #12 concat all preceding \newcommand-containing formulas in a state attribute.
- 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
Labels
No labels