mod: simplify Container and Element creation with updated zterm behavior
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m9s
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m9s
This commit is contained in:
@@ -1,9 +1,32 @@
|
||||
//! Model of the `zterm` application.
|
||||
|
||||
// TODO planned features:
|
||||
// - create change sets (i.e. parse diff headers and provide contents) is the multiarray that what I need?
|
||||
// - create `elements.Change` structs which each point to every change associated to a given file (for each file)
|
||||
|
||||
// FIX known issues:
|
||||
|
||||
const Model = @This();
|
||||
content: []const u8,
|
||||
changes: std.MultiArrayList(Change) = .empty,
|
||||
render_mode: enum {
|
||||
side_by_side,
|
||||
stacked,
|
||||
} = .stacked,
|
||||
|
||||
pub const init: @This() = .{};
|
||||
// TODO alloc-free parsing? (similar to how I've implemented the parser for `smd`?)
|
||||
pub const init: Model = .{
|
||||
.content = &.{},
|
||||
};
|
||||
|
||||
pub const Index = struct {
|
||||
idx: usize,
|
||||
len: usize,
|
||||
};
|
||||
|
||||
pub const Change = struct {
|
||||
file: Index,
|
||||
diff: Index,
|
||||
};
|
||||
|
||||
const Model = @This();
|
||||
const std = @import("std");
|
||||
|
||||
Reference in New Issue
Block a user