diff options
Diffstat (limited to 'src/term/echo.zig')
| -rw-r--r-- | src/term/echo.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/term/echo.zig b/src/term/echo.zig index 4f27a08f..d069fe36 100644 --- a/src/term/echo.zig +++ b/src/term/echo.zig @@ -236,7 +236,8 @@ pub const Echo = struct { fn predict(e: *Echo, pane: *Pane, kind: Kind, seq: u32) bool { const state = pane.terminal orelse return false; const vt = &state.vt; - if (vt.screens.active_key != .primary or !terminal.atBottom(pane) or !vt.modes.get(.cursor_visible)) return false; + const sb = vt.screens.active.pages.scrollbar(); + if (vt.screens.active_key != .primary or sb.offset + sb.len < sb.total or !vt.modes.get(.cursor_visible)) return false; const top = e.tops[e.pane]; const screen = vt.screens.active; const cur: Cursor = e.cursor orelse .{ .x = @intCast(screen.cursor.x), .row = top + screen.cursor.y, .seq = 0 }; @@ -642,7 +643,7 @@ const Rig = struct { const s = try c.render(arena.allocator()); const pane = c.panes[g.shell].?; const body = s.region(.body, g.shell).?.rect; - const y = body.y + terminal.gridCursor(pane).y; + const y = body.y + pardes.Term.grid(pane.terminal).cursor_y; const cell = s.at(body.x + x, y); return .{ .cp = cell.text[0], .ul = cell.style.ul != .off, .cursor = if (s.cursor) |cur| if (cur.y == y) cur.x - body.x else null else null }; } @@ -704,7 +705,7 @@ test "a password prompt shows nothing typed, and a full-screen program is not pr try g.prints(prompt ++ "sudo ls\r\n\x1b]133;C;aid=pardes\x07[sudo] password: "); var arena: std.heap.ArenaAllocator = .init(testing.allocator); defer arena.deinit(); - const x = terminal.gridCursor(g.r.core().panes[g.shell].?).x; + const x = pardes.Term.grid(g.r.core().panes[g.shell].?.terminal).cursor_x; const k = try g.key(.{ .cp = 'h', .text = "h" }); // Predicted, and not drawn: nothing has confirmed an echo here. try testing.expectEqual(@as(u32, 1), g.r.echo.stats.predicted); |
