diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ninep/pty.zig | 4 | ||||
| -rw-r--r-- | src/pardes.zig | 4 | ||||
| -rw-r--r-- | src/terminal.zig | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/ninep/pty.zig b/src/ninep/pty.zig index be5bb83f..b8356681 100644 --- a/src/ninep/pty.zig +++ b/src/ninep/pty.zig @@ -1008,10 +1008,10 @@ test "a run's answer says cut when its output's start is gone, and reads a bound // A resize between its start and end reflows the pins with the text. h = sh.send(p, node); sh.put(p, c ++ "one\r\ntwo\r\n"); - pardes.panes.terminal.resizeGrid(pane, gpa, 50, 20); + pardes.panes.terminal.resizeGrid(pane, 50, 20); sh.put(p, d ++ prompt); try testing.expectEqualStrings("exit 0\none\ntwo\n", sh.answered(p, node, h, into)); - pardes.panes.terminal.resizeGrid(pane, gpa, pane.cols, pane.rows); + pardes.panes.terminal.resizeGrid(pane, pane.cols, pane.rows); // A full-screen program leaves nothing on the primary screen, and a D // with no status is not a success. diff --git a/src/pardes.zig b/src/pardes.zig index fb26840b..2596e069 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -7319,7 +7319,7 @@ pub const Pardes = struct { // doc panes have no pty/emulator grid to reflow; just record // the size so bodyText renders the right number of rows if (pane.isTerminal()) { - panes.terminal.resizeGrid(pane, p.gpa, cols, rows); + panes.terminal.resizeGrid(pane, cols, rows); p.shell_rows.markStale(pane); // reflow moved every row p.emit(.{ .resize_pty = .{ .pane = @intCast(id), .cols = cols, .rows = rows } }); pane.fs.winsize = null; @@ -8731,7 +8731,7 @@ test "jump history terminal rectangle follows output and clears on reflow" { try std.testing.expectEqualStrings("alpha", try edit.selectionText(p, pane, pane.sel[0])); for (0..40) |_| p.update(.{ .output = .{ .pane = 0, .bytes = "more output\r\n" } }); try std.testing.expectEqualStrings("alpha", try edit.selectionText(p, pane, pane.sel[0])); - panes.terminal.resizeGrid(pane, p.gpa, pane.cols - 1, pane.rows); + panes.terminal.resizeGrid(pane, pane.cols - 1, pane.rows); try std.testing.expect(pane.pointerSelection(pane.sel[0]) == null); try std.testing.expectEqual(.none, pane.sel[0].state); } diff --git a/src/terminal.zig b/src/terminal.zig index acc7efdf..29a28e85 100644 --- a/src/terminal.zig +++ b/src/terminal.zig @@ -687,7 +687,7 @@ pub fn followOutput(pane: *Pane) void { /// Reflow the grid. A failed reflow keeps the grid it had rather than dropping /// a scrollback; the next resize retries with the same numbers. -pub fn resizeGrid(pane: *Pane, gpa: std.mem.Allocator, cols: u16, rows: u16) void { +pub fn resizeGrid(pane: *Pane, cols: u16, rows: u16) void { if (comptime !enabled) return; if (authorityOnly("resize a terminal")) return; const state = pane.terminal orelse return; @@ -705,7 +705,6 @@ pub fn resizeGrid(pane: *Pane, gpa: std.mem.Allocator, cols: u16, rows: u16) voi return; } state.changes +%= 1; - _ = gpa; state.vt.resize(state.gpa, .{ .cols = cols, .rows = rows }) catch {}; } @@ -1065,7 +1064,7 @@ test "document construction allocates only the pane and has inert terminal defau try std.testing.expect(!promptInputReady(pane)); scrollGrid(pane, 100); followOutput(pane); - resizeGrid(pane, allocator, 80, 24); + resizeGrid(pane, 80, 24); try std.testing.expectEqual(GridCursor{}, gridCursor(pane)); try std.testing.expectEqual(Scrollbar{}, scrollbar(pane)); try std.testing.expectEqualStrings("", try screenTextAlloc(pane, allocator)); |
