mod: bump zterm dependency; respect scrollbar in calculated size requirement for content
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m19s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m19s
This commit is contained in:
@@ -22,16 +22,13 @@ pub fn Content(App: type) type {
|
||||
}
|
||||
|
||||
fn minSize(ctx: *anyopaque, size: zterm.Point) zterm.Point {
|
||||
// TODO what about that initial size? seems wrong!
|
||||
if (size.x == 0 or size.y == 0) return size;
|
||||
|
||||
const this: *const @This() = @ptrCast(@alignCast(ctx));
|
||||
const text = this.document.content;
|
||||
var index: usize = 0;
|
||||
var new_size: zterm.Point = .{ .x = size.x };
|
||||
|
||||
for (0..text.len) |_| rows: {
|
||||
for (0..size.x) |_| {
|
||||
for (0..size.x - 1) |_| { // assume that there is one cell reserved for the scrollbar
|
||||
if (index == text.len) break :rows;
|
||||
const cp = text[index];
|
||||
index += 1;
|
||||
|
||||
Reference in New Issue
Block a user