From f3b62fe53b19e36f21f8020831718cbf095d6a7b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 3 Jul 2026 17:33:05 -0300 Subject: performance pass --- term.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'term.zig') diff --git a/term.zig b/term.zig index d332488e..cb451b7c 100644 --- a/term.zig +++ b/term.zig @@ -49,8 +49,13 @@ pub const File = struct { content: []u8, // gpa-owned file bytes scroll: usize = 0, // top visible file line /// tree-sitter syntax styles, one byte per `content` byte (0 = none). Empty - /// when the file's language isn't highlighted. gpa-owned. See main.highlightFile. + /// when the file's language isn't highlighted. gpa-owned. `highlight_start` + /// is the content byte offset represented by `highlights[0]`. highlights: []u8 = &.{}, + highlight_start: usize = 0, + /// The content or viewport changed since `highlights` was refreshed for the + /// visible byte window. + syntax_dirty: bool = false, /// dumb whole-content undo/redo: each entry is a gpa-owned snapshot of /// `content`. main.pushUndo snapshots before an edit (one per insert session / /// delete / paste); `u`/`U` move between them. Bounded (oldest dropped). -- cgit v1.3