Skip to content
github-actions[bot] edited this page Apr 12, 2024 · 205 revisions

core.syntax

Where Treesitter can't Reach

When a language not supported by Treesitter is found a fallback is made to use vim regex highlighting.

Overview

The core.syntax module highlights any @code region where there is no treesitter parser present to highlight the region.

This module very closely resembles the concealer, but some parts have been adapted to fit the correct use case.

Author's note:

This module will appear as spaghetti code at first glance. This is intentional. If one needs to edit this module, it is best to talk to me at katawful on GitHub. Any edit is assumed to break this module.

Configuration

  • performance
    (table)

    Performance options for highlighting.

    These options exhibit the same behaviour as the concealer's.

    • increment
      (number)

      How many lines each "chunk" of a file should take up.

      When the size of the buffer is greater than this value, the buffer is then broken up into equal chunks and operations are done individually on those chunks.

      1250
    • interval
      (number)

      How long the syntax module should wait before starting to conceal a new chunk.

      500
    • max_debounce
      (number)

      The maximum amount of recalculations that take place at a single time. More operations than this count will be dropped.

      Especially useful when e.g. holding down x in a buffer, forcing hundreds of recalculations at a time.

      5
    • timeout
      (number)

      How long the syntax module should wait before starting to conceal the buffer.

      0

Required Modules

Clone this wiki locally