Skip to content

[BUG] Syntax highlighting is slow and inefficient. #4685

@amano-kenji

Description

@amano-kenji

Version of Kakoune

v2021.11.08

Reproducer

  • Try to open any file with 20,000 or more lines.
  • Try multi selection editing in the file.

Outcome

For files that have 20,000 lines or more, syntax highlighting is slow.

The file size is still less than 1 megabytes with a bit more than 20,000 lines.

Multi selection editing is also slow due to syntax highlighting. Perhaps, syntax highlighting is updated as I type each letter in editing mode.

neovim doesn't seem to apply syntax highlighting to the whole file. It seems to apply syntax highlighting to just visible parts. But, neovim's syntax highlighting is buggy because it applies syntax highlighting to visible parts only.

3D engines are efficient because they render only what they have to. Recent 3D engines even tweak level of detail dynamically to make rendering more efficient.

Expectations

Syntax highlighting should be efficient.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions