summaryrefslogtreecommitdiff
path: root/core/File.zig
diff options
context:
space:
mode:
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 });
}
};