summaryrefslogtreecommitdiff
path: root/core/File.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 10:29:02 -0300
committerGabriel Schneider <[email protected]>2026-11-22 10:29:02 -0300
commit6544f73a6b50e5ba68564beea7784593bb54348e (patch)
tree4180d5b74cc4c02208b6122618e5b39609b27fc6 /core/File.zig
parent58180ae7574b5050331797f0ead1a1cec753b2ed (diff)
parent06d61f097346704452cccd3181da87bb93649bd8 (diff)
downloadpardes-6544f73a6b50e5ba68564beea7784593bb54348e.tar.gz
pardes-6544f73a6b50e5ba68564beea7784593bb54348e.zip
integration: the source view's changes to their last slice on the installed tree: main (`stpnsymm`: pardes-merge55, installed 2026-11-22) and pardes-layers-6 (`rtzmwzsk` on `owsluptw`, on pardes-layers-5: `Churn [window]`: for each declaration the count of the changes in the window that touched it, a cell after the line number and a strip by the scroll thumb from grey to red on a log scale, jj and the parse on the worker; the chords `SPC t c` and `SPC t u`; the manual's chapter "Changes on the source view" and the cheatsheet's rows); no conflict; core-test 915/1079 (164 skipped), shell-test 1121/1124; its gate: .scratch/sketch/reorg/merge56, the numbers in PARDES.md (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/File.zig')
-rw-r--r--core/File.zig15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/File.zig b/core/File.zig
index 347f4809..c4fc8a38 100644
--- a/core/File.zig
+++ b/core/File.zig
@@ -373,7 +373,7 @@ pub fn gutterWidth(pane: *const Pane) u16 {
var lines = if (file.line_starts.len > 0) file.line_starts.len else lineCount(file.content);
var digits: u16 = 1;
while (lines >= 10) : (lines /= 10) digits += 1;
- return @max(config.PREFIX_W, digits + 1) + laneCells(pane);
+ return @max(config.PREFIX_W, digits + 1) + laneCells(pane) + pane.layers.heat;
}
/// The cells the changes' lanes take after the line number in this view
@@ -758,7 +758,7 @@ fn edit(p: *Pardes, f: *State, off: usize, len: usize, bytes_in: []const u8, who
};
reportEdit(p, f, off, len, bytes);
// A pinned change's per-line values ride with the lines (jj.zig).
- if (p.changes.answers.items.len > 0) jj.edited(p, f, off, len, bytes);
+ if (p.changes.answers.items.len | p.changes.heats.items.len > 0) jj.edited(p, f, off, len, bytes);
if (f.mini) |*mini| mini.deinit(p.gpa);
f.mini = null;
if (f.line_starts.len > 0) shiftIndex(p.gpa, f, off, len, bytes);
@@ -1779,7 +1779,7 @@ fn geometryKey(pane: *const Pane, f: *const State) u64 {
if (f.output) |o| pardes.walk.digest(Output.Origin, &o.from) else 0, std.hash.Wyhash.hash(0, f.path), f.tree_context, f.context.revision orelse 0,
f.context.declarations.len, f.line_starts.len, t.revision orelse 0, t.list.items.len,
pane.view.wrap, pane.view.layered, pane.view.body_h, pane.view.tagline_h,
- pane.view.rect_h, laneCells(pane),
+ pane.view.rect_h, laneCells(pane) + @as(u16, pane.layers.heat),
};
// One hash of them laid out as words: every reader of the map asks for
// this key, a hundred times a frame.
@@ -1797,8 +1797,8 @@ fn geometryKey(pane: *const Pane, f: *const State) u64 {
fn fillBody(comptime ghosted: bool, tab: u16, dst: ?[]u8, pane: *Pane, f: *State, width: usize, record_wrap: bool) usize {
if (record_wrap) pane.wrap_n = 0;
const prefix_width = gutterWidth(pane);
- // Where a number ends: a blank, then the lanes (laneCells), after it.
- const number_end = prefix_width -| laneCells(pane) -| 1;
+ // Where a number ends: a blank, then the heat lane and the lanes after it.
+ const number_end = prefix_width -| laneCells(pane) -| pane.layers.heat -| 1;
const total = nlines(pane.gpa, f);
// The slot after the text's last newline, found once: every numbered
// row below asks whether it is that one.
@@ -1949,9 +1949,12 @@ pub const Layers = struct {
/// frontend, in a window two, which its strips of pixels fill one and
/// a half of (Surface.Lane), in a terminal three, a glyph each.
lanes: u8 = 0,
+ /// Whether this view shows the pane's churn (`Churn`, jj.Heat), as the
+ /// cells its lane takes: one after the number, before the lanes.
+ heat: u8 = 0,
pub fn digest(l: *const Layers, h: *pardes.walk.Hasher) void {
- h.update(&.{ @intFromBool(l.ink), l.lanes });
+ h.update(&.{ @intFromBool(l.ink), l.lanes, l.heat });
}
};