feat: accept argument for path to open
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m14s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m14s
This commit is contained in:
@@ -3,10 +3,10 @@ pub fn Content(App: type) type {
|
||||
allocator: Allocator,
|
||||
document: *const App.Model.Document,
|
||||
|
||||
pub fn init(allocator: Allocator) @This() {
|
||||
pub fn init(allocator: Allocator, document: *const App.Model.Document) @This() {
|
||||
return .{
|
||||
.allocator = allocator,
|
||||
.document = undefined,
|
||||
.document = document,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user