summaryrefslogtreecommitdiff
path: root/core/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-21 01:37:10 -0300
committerGabriel Schneider <[email protected]>2026-11-21 06:19:35 -0300
commit2d25d58f8132c54ca0f853899d6b525c4ae892e4 (patch)
treebe6d88b78a0ac46e0347d1569b77ccbae27f6b57 /core/builtins.zig
parent6d937cd125ca04a2edb92b2d014014ee6c2eb45d (diff)
downloadpardes-2d25d58f8132c54ca0f853899d6b525c4ae892e4.tar.gz
pardes-2d25d58f8132c54ca0f853899d6b525c4ae892e4.zip
layers: the source view's painters a seam with nothing to see but one word: File.Layers (core/File.zig, beside recolorSyntax), a pane's field that each view keeps its own (views.zig pane_fields), says which painters a file's body wears and writes down their order and places (1 the ink, tree-sitter's colour a code cell; 2 the patch, a diff's grounds, marker and changed words; next, ruled and not built: changes, a lane after the line number, green and red grounds, a changed line's words, ghost rows; churn, a heat lane and a strip by the scroll thumb), both still painted in recolorSyntax's one walk; Syntax (a tag word, SPC t h: SPC t s is the pdf addon's PdfSections, a ctl line) turns the ink off in this view and on again; the ink off is no style byte read at all (a test a cell, as a branch or a mask, cost the frame 0.1 to 0.5% of its instructions, 0.15 to 0.47% on the long line; a walk specialised at comptime for each state cost 0.5 to 3.4%: the gate measured all three), so in a patch Syntax takes its grounds too; File.zig's test draws a .zig text's first row with the ink, without it, in a second view that keeps its own, and with it again; tui core-test 876/1034 (158 skipped); the tip's gate: frames 77/77, the 121 counts within 0.1% of tree3 (largest +0.026%), perfab -0.013%
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/builtins.zig')
-rw-r--r--core/builtins.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/builtins.zig b/core/builtins.zig
index 7ad70e7c..b516d543 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -1060,6 +1060,15 @@ pub const Filter = struct {
}
};
+/// Turn a text's syntax colours off in this view, or on again.
+/// The ink layer (File.Layers).
+pub const Syntax = struct {
+ pub fn run(c: Ctx) void {
+ if (c.pane.file == null) return c.p.reportFailure(c.id, "Syntax: only a text pane has it");
+ c.pane.layers.ink = !c.pane.layers.ink;
+ }
+};
+
/// Stack a diff's hunks as a diff viewer shows them, each under its place and the declarations around it, in a +Diff; on a +Diff, show the diff itself as text. `Diff <file>` stacks that diff's, `Diff <revision>` git show's.
/// The diff viewer's one registration: its word and traits here, all else
/// its own (hunks.zig).