diff options
Diffstat (limited to 'core/Core.zig')
| -rw-r--r-- | core/Core.zig | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/core/Core.zig b/core/Core.zig index 8616aa35..1dd03524 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -2019,7 +2019,7 @@ pub fn sync(p: *Pardes) void { pub fn ptySize(p: *const Pardes, id: Pane.Id, cells: ?[2]u16) pardes.PtySize { const pane = p.panes[id.index()] orelse return .{ .cols = 1, .rows = 1 }; const c = cells orelse .{ pane.cols, pane.rows }; - const cell = (p.views[pane.sized_by] orelse p.views[p.live].?).cell_pixels; + const cell = (if (pane.sized_by) |k| p.views[k] orelse p.views[p.live].? else p.views[p.live].?).cell_pixels; return .{ .cols = @max(c[0], 1), .rows = @max(c[1], 1), .w_px = std.math.cast(u16, @as(u32, c[0]) * cell.w) orelse 0, .h_px = std.math.cast(u16, @as(u32, c[1]) * cell.h) orelse 0 }; } @@ -2030,16 +2030,15 @@ fn typedInto(p: *Pardes) void { } /// Whether the live view sizes terminal `pane`: a terminal shown at two -/// sizes takes the size of the view that typed into it last, and any -/// view's once that one is gone. The others show it at that size, a -/// shorter one passed down to its cursor (`Pane.pan`, Pane.panFor). +/// sizes takes the size of the view that typed into it last, and keeps it +/// once that view is gone until another types into it (views.dropView): +/// a view nobody types in never takes it. The others show it at that +/// size, a shorter one passed down to its cursor (`Pane.pan`, +/// Pane.panFor). // ponytail: a panned view's pointer reports to a terminal's program and // its kitty images are placed as the unpanned rows are. -fn sizes(p: *Pardes, pane: *Pane) bool { - if (pane.sized_by == p.live) return true; - if (Views.isOpen(p, pane.sized_by)) return false; - pane.sized_by = p.live; - return true; +fn sizes(p: *const Pardes, pane: *const Pane) bool { + return pane.sized_by == p.live; } pub fn theme(p: *const Pardes) *const Theme { |
