diff options
Diffstat (limited to 'src/term/terminal.zig')
| -rw-r--r-- | src/term/terminal.zig | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/term/terminal.zig b/src/term/terminal.zig index 71a2f3de..0178a848 100644 --- a/src/term/terminal.zig +++ b/src/term/terminal.zig @@ -1191,11 +1191,12 @@ pub fn viewport(state: *State, arena: std.mem.Allocator, cut: bool) ![]const []c } /// Its view's rows as cells, for the core's paint (Term.paint, the core's -/// src/ansi.zig): `rows.len` rows of `cols` cells into `cells`, each its -/// style in the theme's colours (through the filter when `filtered`), the -/// bytes it spells in the view's text and its width; each row whether a -/// prompt starts it, and how much of it that is. -pub fn paint(state: *State, ink: *const Ink, palette: *FilterPalette, filtered: bool, cols: u16, cells: []Painted, rows: []PaintedRow) void { +/// src/ansi.zig): `rows.len` rows from the view's row `first`, `cols` +/// cells each into `cells`, each its style in the theme's colours (through +/// the filter when `filtered`), the bytes it spells in the view's text and +/// its width; each row whether a prompt starts it, and how much of it that +/// is. +pub fn paint(state: *State, ink: *const Ink, palette: *FilterPalette, filtered: bool, first: u16, cols: u16, cells: []Painted, rows: []PaintedRow) void { var filter_storage: Filter = undefined; const filter: ?*Filter = if (filtered) blk: { filter_storage = filterOf(ink, palette, &state.vt); @@ -1207,7 +1208,7 @@ pub fn paint(state: *State, ink: *const Ink, palette: *FilterPalette, filtered: const pages = &state.vt.screens.active.pages; for (rows, 0..) |*row, vi| { row.* = .{ .prompt = null, .placeholder = false, .len = 0 }; - const row_pin = pages.pin(.{ .viewport = .{ .y = @intCast(vi) } }) orelse continue; + const row_pin = pages.pin(.{ .viewport = .{ .y = @intCast(first + vi) } }) orelse continue; const flags = row_pin.rowAndCell().row; if (flags.semantic_prompt != .none) row.prompt = promptCut(row_pin); row.placeholder = flags.kitty_virtual_placeholder; |
