Quick answer: Godot 4 TextEdit silently disabling syntax highlighting on files > 10k lines? Performance protection; raise the threshold or use a custom highlighter.

Long markdown editor: highlighting works on 5k lines; disappears at 11k.

Raise threshold

TextEdit's syntax_highlighting_max_lines (or custom highlighter config). Increase to expected max.

Or use chunked highlight

Highlight only visible lines; updates on scroll. Visible window is small; cost bounded.

Or accept the limit

For most use cases, 10k lines is plenty. If your case is the exception, the chunked path is right.

“Performance limits are configurable. Defaults trade features for predictable performance.”

If your TextEdit content scales beyond defaults, the chunked highlighter is the right primitive.

Related reading