Skip to content

highlighter: compute_injection_layers reparses on every edit #2991

Description

@zanmato

Issue

Old trees are only re-used if the byte ranges match, so a single character can break all trees. The trees are never edited either.

Proposal

We should reparse injection layers incrementally instead, keep the trees, edit them and map the ranges instead of throwing them away. This will save a lot of foreground time in markdown files and other languages with injection layers.

How to test

This is further amplified by multi cursors, e.g. select 8 columns, add some text and then undo. This will reparse injection layers from scratch 8 times.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions