summaryrefslogtreecommitdiff
path: root/core/File.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 17:40:17 -0300
committerGabriel Schneider <[email protected]>2026-11-25 18:05:10 -0300
commit1e8787e0b2eb3eaa4991a5160f6e5c35ba6f132e (patch)
tree255534be4abebd88f1a85d306d0111a339d172b3 /core/File.zig
parent6ef1941324aa578750d54567c1ed201ad36412b8 (diff)
downloadpardes-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/File.zig')
-rw-r--r--core/File.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/File.zig b/core/File.zig
index 18745930..41cc025f 100644
--- a/core/File.zig
+++ b/core/File.zig
@@ -1258,6 +1258,8 @@ fn edit(p: *Pardes, f: *State, off: usize, len: usize, bytes_in: []const u8, who
// A pinned change's per-line values ride with the lines (jj.zig), in
// the file's lines.
if (told and p.changes.answers.items.len | p.changes.heats.items.len > 0) jj.edited(p, f, off, len, bytes);
+ // A message's places in it no longer know their lines (Messages.edited).
+ if (told and len + bytes.len > 0) p.messages.edited(f.path);
if (f.mini) |*mini| mini.deinit(p.gpa);
f.mini = null;
if (f.line_starts.len > 0) shiftIndex(p.gpa, f, off, len, bytes);