WIP: use viewport to allow sizes of scroll to extend further than renderable screen

This commit is contained in:
2025-02-12 22:33:03 +01:00
parent 98031dbd1a
commit bbe6f4741e
9 changed files with 119 additions and 51 deletions

View File

@@ -2,7 +2,8 @@ const std = @import("std");
pub const code_point = @import("code_point");
const Key = @import("key.zig");
const Size = @import("size.zig");
const Position = @import("size.zig").Position;
const Size = @import("size.zig").Size;
const Cell = @import("cell.zig");
const log = std.log.scoped(.terminal);
@@ -78,7 +79,7 @@ pub fn writer() Writer {
return .{ .context = .{} };
}
pub fn setCursorPosition(pos: Size.Position) !void {
pub fn setCursorPosition(pos: Position) !void {
var buf: [64]u8 = undefined;
const value = try std.fmt.bufPrint(&buf, "\x1b[{d};{d}H", .{ pos.row, pos.col });
_ = try std.posix.write(std.posix.STDIN_FILENO, value);