summaryrefslogtreecommitdiff
path: root/core/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 02:37:06 -0300
committerGabriel Schneider <[email protected]>2026-11-22 02:37:06 -0300
commit58180ae7574b5050331797f0ead1a1cec753b2ed (patch)
tree4a866bdfc968afe58f1f954f969b9c0ab00bc449 /core/panes.zig
parent245dd088a5b502c72f94c85bf1cc5bd0ba7ebb56 (diff)
parent2015baa4ccd26a74b51e7b7cda0eb3533a325142 (diff)
downloadpardes-58180ae7574b5050331797f0ead1a1cec753b2ed.tar.gz
pardes-58180ae7574b5050331797f0ead1a1cec753b2ed.zip
integration: the tree to install: every client's terminals by the pty's bytes, and the source view's changes to the whole mock: pardes-flip (`uxzzxrtt`, on pardes-merge54: the one road by default, the old one behind PARDES_TERM_SCREEN until it is deleted; a client takes its road from the session's welcome: the wire at 29; the predicted echo kept on the one road; the user's ruling of 2026-11-22) and pardes-layers-5 (`qurmskql` on `yxupukvr` on `tllltqkq` on `qwvwsoww`, on pardes-layers-4: a terminal's output pays less for the layers with `Changes` off; ghost rows: a line taken away whole red across, each change's description after its last line; a changed line's words by the patch view's alignment; `]g` and `[g`; a description row keeps its author and age, a change's rows come before its own description); no conflict; core-test 911/1075 (164 skipped), shell-test 1117/1120; its gate: .scratch/sketch/reorg/merge55, 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/panes.zig')
-rw-r--r--core/panes.zig20
1 files changed, 16 insertions, 4 deletions
diff --git a/core/panes.zig b/core/panes.zig
index 2f561d05..289de70f 100644
--- a/core/panes.zig
+++ b/core/panes.zig
@@ -31,7 +31,7 @@ pub const Pane = struct {
/// it (views.zig). (The 9P server's part of `fs` says so in its type.)
pub const replica = .{
.local = .{ "pv", "pv_known" },
- .derived = .{ "wrap_line", "wrap_col", "wrap_pad", "wrap_n", "body_wrapped", "context_rows", "body_rows", "body_visible_rows", "context_row_limit", "geometry_key", "geometry_len", "notices", "pan" },
+ .derived = .{ "wrap_line", "wrap_col", "wrap_pad", "wrap_n", "body_wrapped", "context_rows", "body_rows", "body_visible_rows", "context_row_limit", "geometry_key", "geometry_len", "notices", "pan", "ghosts", "ghost_text" },
.len = .{ .{ "msg", "msg_len" }, .{ "msg_older", "msg_older_len" }, .{ "question", "question_len" }, .{ "shell_tail", "shell_tail_len" }, .{ "sel_snap", "nsel_snap" } },
// A picture's memory is its own allocator's (a dump loaded makes
// it there).
@@ -308,6 +308,14 @@ pub const Pane = struct {
wrap_col: [limits.wrap_rows]i32 = undefined,
wrap_pad: [limits.wrap_rows]u16 = @splat(0),
wrap_n: u16 = 0,
+ /// The ghost rows of its pinned changes (jj.zig, `Ghost`: lines a
+ /// change took away, a change's description), the session's answers'
+ /// (`Pardes.changes`) as its geometry reads them while a view shows
+ /// them (`layers.lanes`): set by jj.showGhosts. A ghost row's `wrap_col` is
+ /// negative, `-1 - ` its index here, and its `wrap_line` the line it
+ /// stands before.
+ ghosts: []const @import("jj.zig").Ghost = &.{},
+ ghost_text: []const u8 = "",
/// A row map also exists for sticky headers when soft wrapping is off.
body_wrapped: bool = false,
context_rows: u16 = 0,
@@ -596,10 +604,14 @@ pub const Pane = struct {
return pane.surfRow(@as(i32, @intCast(Term.grid(pane.terminal).offset)) + pane.pan);
}
- pub fn wrapAt(pane: *Pane, tab: u16, vr: i32) struct { line: i32, at: i32, pad: i32 = 0 } {
+ /// The line and byte a body row shows from; a ghost row (jj.zig) is no
+ /// line's: `ghost`, the line below it at its start.
+ pub fn wrapAt(pane: *Pane, tab: u16, vr: i32) struct { line: i32, at: i32, pad: i32 = 0, ghost: bool = false } {
File.geometry(tab, pane);
- if (pane.wrap_n > 0 and vr >= 0 and vr < @as(i32, pane.wrap_n))
- return .{ .line = pane.wrap_line[@intCast(vr)], .at = pane.wrap_col[@intCast(vr)], .pad = pane.wrap_pad[@intCast(vr)] };
+ if (pane.wrap_n > 0 and vr >= 0 and vr < @as(i32, pane.wrap_n)) {
+ const at = pane.wrap_col[@intCast(vr)];
+ return .{ .line = pane.wrap_line[@intCast(vr)], .at = @max(at, 0), .pad = pane.wrap_pad[@intCast(vr)], .ghost = at < 0 };
+ }
// unwrapped: rows ARE lines, and the byte column a row starts at is the
// horizontal scroll (always 0 on a terminal, which never has one)
return .{ .line = pane.scroll() + vr, .at = pane.hscroll };