mod(Header): move name to the right hand side
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 30s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 30s
This commit is contained in:
@@ -33,6 +33,18 @@ pub fn deinit(this: *@This()) void {
|
||||
fn fillView(this: *@This()) void {
|
||||
this.view.?.clear();
|
||||
|
||||
if (this.path) |path| {
|
||||
for (0..path.len, this.view.?.screen.width / 2 - path.len / 2..) |i, col| {
|
||||
const cell: vaxis.Cell = .{
|
||||
.char = .{ .grapheme = path[i .. i + 1] },
|
||||
.style = .{
|
||||
.ul_style = .single,
|
||||
},
|
||||
};
|
||||
this.view.?.writeCell(col, 0, cell);
|
||||
}
|
||||
}
|
||||
|
||||
const msg = "Yves Biener";
|
||||
for (msg, 0..) |_, i| {
|
||||
const cell: vaxis.Cell = .{
|
||||
@@ -46,25 +58,7 @@ fn fillView(this: *@This()) void {
|
||||
.bold = true,
|
||||
},
|
||||
};
|
||||
this.view.?.writeCell(i, 0, cell);
|
||||
}
|
||||
|
||||
if (this.path) |path| {
|
||||
// TODO: this could be a static string on the heap (due to the size of `513`)
|
||||
for (0..path.len, this.view.?.screen.width / 2 - path.len / 2..) |i, col| {
|
||||
const cell: vaxis.Cell = .{
|
||||
.char = .{ .grapheme = path[i .. i + 1] },
|
||||
.style = .{
|
||||
.ul_style = .single,
|
||||
},
|
||||
};
|
||||
this.view.?.writeCell(col, 0, cell);
|
||||
}
|
||||
|
||||
// fill rest with default cells
|
||||
for (this.view.?.screen.width / 2 + path.len..this.view.?.screen.width) |i| {
|
||||
this.view.?.writeCell(i, 0, .{ .default = true });
|
||||
}
|
||||
this.view.?.writeCell(this.view.?.screen.width - msg.len - 3 + i, 0, cell);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user