summaryrefslogtreecommitdiff
path: root/term.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-03 17:33:05 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commitf3b62fe53b19e36f21f8020831718cbf095d6a7b (patch)
treecdfd008869bb5f5aeb69f0ef30584fec86f6f95b /term.zig
parent6b4b1f76bb6bf969fb5106f95fb3f9ad077fac08 (diff)
downloadpardes-f3b62fe53b19e36f21f8020831718cbf095d6a7b.tar.gz
pardes-f3b62fe53b19e36f21f8020831718cbf095d6a7b.zip
performance pass
Diffstat (limited to 'term.zig')
-rw-r--r--term.zig7
1 files changed, 6 insertions, 1 deletions
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).