summaryrefslogtreecommitdiff
path: root/src/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/panes.zig')
-rw-r--r--src/panes.zig11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/panes.zig b/src/panes.zig
index 71a04464..89f24eb6 100644
--- a/src/panes.zig
+++ b/src/panes.zig
@@ -30,7 +30,7 @@ pub const Pane = struct {
/// 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" },
+ .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", "pan" },
.authority = .{"fs"},
.len = .{ .{ "msg", "msg_len" }, .{ "msg_older", "msg_older_len" }, .{ "question", "question_len" }, .{ "shell_tail", "shell_tail_len" }, .{ "sel_snap", "nsel_snap" } },
};
@@ -309,6 +309,13 @@ pub const Pane = struct {
/// The view that last typed into it: a terminal shown at two sizes takes
/// that view's (Pardes.sync).
sized_by: u8 = 0,
+ /// A terminal shown in a view shorter than it (one that does not size
+ /// it): the rows its top is passed over by, so its cursor stays in
+ /// sight (terminal.panFor); 0 everywhere else.
+ pan: u16 = 0,
+ /// The view whose step a `.name` prompt is (tagline.draftName): only
+ /// that view's focus leaving the pane drops it.
+ prompt_view: u8 = 0,
pub const MessagePhase = enum { entering, shown, lingering, leaving };
/// One message line's animation: falling in, shown, lingering after the
@@ -543,7 +550,7 @@ pub const Pane = struct {
pub fn scroll(pane: *Pane) i32 {
if (pane.file) |f| return @intCast(f.scroll);
if (comptime Pdf.enabled) if (pane.pdf) |pv| return @intCast(pv.text_scroll);
- return pane.surfRow(terminal.gridOffset(pane));
+ return pane.surfRow(terminal.gridOffset(pane) + pane.pan);
}
pub fn wrapAt(pane: *Pane, vr: i32) struct { line: i32, at: i32, pad: i32 = 0 } {