diff options
Diffstat (limited to 'src/panes.zig')
| -rw-r--r-- | src/panes.zig | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/panes.zig b/src/panes.zig index a782e3e0..71a04464 100644 --- a/src/panes.zig +++ b/src/panes.zig @@ -1,6 +1,7 @@ const std = @import("std"); const vaxis = @import("vaxis"); const pardes = @import("pardes.zig"); +const views = @import("views.zig"); const layout = @import("layout.zig"); const config = @import("config.zig"); const Pardes = pardes.Pardes; @@ -26,8 +27,9 @@ pub const EditText = struct { text: []u8, row0: i32 }; pub const Pane = struct { /// What the replay digest leaves out (src/walk.zig): the view's geometry, /// made again from the rest (File.geometry); the 9P server's record of - /// the pane's opens and readers. + /// the pane's opens and readers; the other views' share of it (views.zig). 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", "view", "notices" }, .authority = .{"fs"}, .len = .{ .{ "msg", "msg_len" }, .{ "msg_older", "msg_older_len" }, .{ "question", "question_len" }, .{ "shell_tail", "shell_tail_len" }, .{ "sel_snap", "nsel_snap" } }, @@ -95,6 +97,7 @@ pub const Pane = struct { pub const Cwd = union(enum) { none, inherited: *Pane, owned: []u8 }; pub const Focus = enum { body, tag }; + pub const SessionView = struct { wrap: bool = true, layered: bool = true, body_h: u32 = 0, tagline_h: u32 = 0, rect_h: u16 = 0 }; terminal: ?*terminal.State = null, gpa: std.mem.Allocator, serial: u32 = 0, @@ -263,7 +266,7 @@ pub const Pane = struct { geometry_key: u64 = 0, geometry_len: usize = 0, /// The session's part of the geometry, as of the last step (`sync`). - view: struct { wrap: bool = true, layered: bool = true, body_h: u32 = 0, tagline_h: u32 = 0, rect_h: u16 = 0 } = .{}, + view: SessionView = .{}, sel: [3]Sel = @splat(.{}), pointer_selections: [3]?PointerSelection = @splat(null), next_pointer_selection: u64 = 0, @@ -297,6 +300,15 @@ pub const Pane = struct { /// body layer reserves exactly `len` rows for them, the way it already /// reserves rows for sticky context headers. notices: Notices = .{}, + /// Each other view's share of this pane, while it is not live + /// (views.zig): its cursor, scroll and place in that view's layout. + pv: [views.max]views.PaneView = undefined, + /// The views `pv` holds a share for (a pane retired before a view came + /// has none of it). + pv_known: u8 = 0, + /// The view that last typed into it: a terminal shown at two sizes takes + /// that view's (Pardes.sync). + sized_by: u8 = 0, pub const MessagePhase = enum { entering, shown, lingering, leaving }; /// One message line's animation: falling in, shown, lingering after the |
