diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-25 17:40:17 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-25 18:05:10 -0300 |
| commit | 1e8787e0b2eb3eaa4991a5160f6e5c35ba6f132e (patch) | |
| tree | 255534be4abebd88f1a85d306d0111a339d172b3 /core/body_layer.zig | |
| parent | 6ef1941324aa578750d54567c1ed201ad36412b8 (diff) | |
| download | pardes-1e8787e0b2eb3eaa4991a5160f6e5c35ba6f132e.tar.gz pardes-1e8787e0b2eb3eaa4991a5160f6e5c35ba6f132e.zip | |
Messages: a place whose file changed since the run that named it draws no words at its line, and unrolls no detail there (UX DESIGN H, binding: with SPC e keeping the error, Y2's wpqvkssr, a line put in above it left the error's words on the line that had moved down to it, `) std.Io.Writer.Error!void { ✗ local variable is never mutated` until the rebuild; a mark on the wrong line is worse than none, until places follow edits); THE CAUSE: a message's places are a path, a line and a column said once (readPlaces, diskDiff), and messageGhosts and firstAt (the words, the detail, K and SPC e on the line, a click on the words) drew them on that line whatever the file's text became; no anchor carries them: Places' anchors are a pane's search places in its own offsets (Places.shift by File.splice), jj.edited carries the Changes layer's per-line values only; THE FIX: Place.stale, set for every live place naming a file by any edit of its text (File.edit's told edits with bytes in or out: a key, an undo, a paste, a language server's edit and a Get through File.load; not the Changes layer's lines going in or out, nor an empty splice); messageGhosts and firstAt pass a stale place by; the box's mark (Said.about) and the notice row keep it, and SPC e still walks it, until the next run's error names fresh places (commandDone's, never stale); bounded by the live messages' places (16 x 4) per edit; RUN (TEST FIRST): Messages.zig "a file changed since the run that named its places draws none of their words at its lines ..." says an error at line 4 of a file shown, its words drawn after `var s = 1;`, then puts a line in above through File.load (a code action's way, Ask.applyLspEdits) and asks the frame for the words on no row while the box's `✗` and the notice row's `/test.txt:4:9` stay; the next run's error at line 5 drawn there again; then `var` replaced by `const` on that line and the words on no row: fails on M12+Y2 (lnqvtpmx) at Messages.zig:1960 (the words still drawn, on the line moved down to 4), passes now; the probe (VIDEO's kit, this change's Debug build, tally): after SPC e the words on line 11, after zls's `organize @import` and a save none on line 11 or 12 with the box's ✗ and the notice row's `report.zig:11:9` kept, after the rebuild the words on line 12; a user hit it with any edit above an error walked to with SPC e before the next build; core-test 1112/1284 (172 skipped: +1), shell-test 1332/1335 (3 skipped: +1), process-test 0 of 147 failed (3 skipped, no golden moved), behaviour-test 280/280; the dump fuzz at 40,000 join seeds twice and 1,779 image seeds 11/11 (Place gained a field); the soak `replicas -- --clients 5 --rtt 30,80,207`: diverged 0, unequal 0, quiet checks 725/0 434/0 519/0, stops not on may_wait 0, the corpus 22 of 22 scenes the same, no leak; load 1.7 to 5.1
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/body_layer.zig')
| -rw-r--r-- | core/body_layer.zig | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/body_layer.zig b/core/body_layer.zig index f00da4a9..5e23a415 100644 --- a/core/body_layer.zig +++ b/core/body_layer.zig @@ -575,10 +575,11 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane /// A message at the lines it names, drawn and never written (SPEC §10.2, /// ruling R3): after the end of each such line shown, the message's glyph -/// and its words there; under the caret's line, when the keyboard is in -/// this body, the lines that explain it where the step put them -/// (Pane.ghost_at, ghost_rows: Messages.detailUnder), pushing the rows -/// below down (the rows past the body's foot are not shown meanwhile). +/// and its words there, unless the file changed since (Place.stale); +/// under the caret's line, when the keyboard is in this body, the lines +/// that explain it where the step put them (Pane.ghost_at, ghost_rows: +/// Messages.detailUnder), pushing the rows below down (the rows past the +/// body's foot are not shown meanwhile). /// Bounded by the rows shown and the live messages' places /// (Messages.max_live, Said.max_places). fn messageGhosts(p: *Pardes, s: *Surface, pane: *Pane, tx: u16, tw: u16, body_y: u16, body_h: u16) void { @@ -591,7 +592,7 @@ fn messageGhosts(p: *Pardes, s: *Surface, pane: *Pane, tx: u16, tw: u16, body_y: var hits: [Messages.max_live * Messages.Said.max_places]Hit = undefined; var n: usize = 0; for (p.messages.live[0..p.messages.live_len]) |*said| for (said.places[0..said.places_len]) |*place| { - if (place.line == 0 or !std.mem.eql(u8, place.path.slice(), f.path)) continue; + if (place.line == 0 or place.stale or !std.mem.eql(u8, place.path.slice(), f.path)) continue; hits[n] = .{ .line = place.line - 1, .said = said, .place = place }; n += 1; }; |
