summaryrefslogtreecommitdiff
path: root/src/ansi.zig
Commit message (Collapse)AuthorAge
* Term: paint only the view's rows the body shows (docs/next-terminal.md, ↵HEADmainGabriel Schneider13 hours
| | | | Phase 1 as built): Term.paint takes the first row, and ansi.recolor walks the body once first for the rows its grid lines and an edit copy's lines stand over, so a pane shorter than its terminal (perf's render gesture: a 3-row shell strip beside the file, its terminal still 118x37 until the next update resizes it to 118x2) no longer paints 37 rows of cells (4,366 Painted, 20 bytes each, 87 KB a frame) to show 2, as Phase 0's walk never did; render on medium, best of ten, back to back against the tree before: tui Debug 126/124/127 -> 81/82/81 us, gui Debug 128/129/124 -> 82/83/82, tui ReleaseFast 110/107/112 -> 75/74/74 (the old baselines: 81, 81, 73), 0.72M instructions:u a frame fewer, every other gesture unchanged; perf --terminal-mib 8 and 32 (instructions:u, 3 runs each): 3,928.7M -> 3,928.5M and 13,219.2M -> 13,217.9M; the perf baselines recorded anew in the three shapes (Zig 0.17.1, harness aed36aceb98afadd), so unit-test's perf check passes again; tui core-test 811/950 (139 skipped), shell-test 993/996, term-test 15/15, pane-test 180/181, kitty-test 45/45, behaviour-test 269/273 (the four addon ABI tests the base fails), process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's), replicas pass (checked/wrong 0), image-harness and kitty-harness pass, unit-test 1528/1536 (the four addon tests); gui core-test 811/950, image-harness and kitty-harness pass, unit-test 1587/1595 (the four addon tests)
* ansi: the command pane's diff colours beside the terminal's ↵Gabriel Schneider13 hours
| | | | (docs/next-terminal.md, Phase 1; reports/diff-module.md, question 3, the user: "keep it but make it close in code to the pager so they're together"): File.DiffOutput and File.recolorDiffOutput move, as they are, from File.zig to src/ansi.zig, where the terminal's painted cells are laid over the body, so the colours a finished command pane's diff is given sit beside the colours its program gave it; body_layer calls ansi.recolorDiffOutput after ansi.recolor as it called File's; File.synStyle and File.SynStyle become pub for it (File's own recolorSyntax still the other caller); Core's diff_output is an ansi.DiffOutput; nothing else changes; core-test 810 of 949 (139 skipped), process-test's diffview and diffstack goldens unchanged (the suite's other failures the base's: lspcomplete, lspcompletemoved; exec once under load, passing on its retry)
* Term: the draw group as plain data (docs/next-terminal.md, Phase 1): the ↵Gabriel Schneider13 hours
terminal paints its view into a plain cell buffer and the core lays it over the body's rows; Term.paint gives each of its view's rows (Term.PaintedRow: the prompt cut a shell's marks make of it, its kitty placeholders, how many cells it has) and each cell (Term.Painted: its style in the theme's colours, through the filter when the pane has it on, the bytes it spells, its width) for a theme handed in as Term.Ink; src/ansi.zig, new, is the core's half of what was terminal.zig's recolorAnsi, moved: the body walk, the edit copy's anchors (EditAnchors, its rows from Term.editRows) and the grapheme-to-cell alignment, now reading the buffer instead of the emulator's pages, and drawImages' body walk (Term.images takes the rows it maps and appends placements to the frame's list, blanking placeholder cells in its cells, as TerminalImages.draw did through Pardes); the filter stays the terminal's (it wraps ghostty's generate256Color), its record plain (Term.Filter, Term.FilterPalette in src/plain/term.zig, [3]u8 for ghostty's RGB), so a +Pager's spans are drawn through Term.filter and Term.spanColor, and palColor is Ink.palColor; config.tty_filter_min_contrast goes to the filter it bounds; Term.Grid gains the grid's cols; the filter tests reach the plain record's fields through asGhostRgb, asserting what they did; perf --terminal-mib (tail-style line off, ReleaseFast, instructions:u, 3 runs each, ±30k): 8 MiB 4,347.9M -> 3,949.8M (4.51M -> 4.09M a batch), 32 MiB 14,729.1M -> 13,294.4M (3.82M -> 3.45M a batch), the copy costs nothing that shows and the frame got cheaper; core-test 985/985, kitty-test 45/45, pane-test 151/152 (1 skipped), behaviour-test 268/272 (the four addon ABI 3.0 tests the base fails), replicas checked/wrong 0