refactor: zigify imports and correct minor mistakes
This commit is contained in:
11
src/cell.zig
11
src/cell.zig
@@ -1,11 +1,8 @@
|
||||
const std = @import("std");
|
||||
const Style = @import("style.zig");
|
||||
//! Cell type containing content and formatting for each character in the terminal screen.
|
||||
|
||||
pub const Cell = @This();
|
||||
|
||||
style: Style = .{ .emphasis = &.{} },
|
||||
// TODO embrace `zg` dependency more due to utf-8 encoding
|
||||
cp: u21 = ' ',
|
||||
style: Style = .{ .emphasis = &.{} },
|
||||
|
||||
pub fn eql(this: Cell, other: Cell) bool {
|
||||
return this.cp == other.cp and this.style.eql(other.style);
|
||||
@@ -20,6 +17,10 @@ pub fn value(this: Cell, writer: anytype) !void {
|
||||
try this.style.value(writer, this.cp);
|
||||
}
|
||||
|
||||
const std = @import("std");
|
||||
const Style = @import("style.zig");
|
||||
const Cell = @This();
|
||||
|
||||
test "ascii styled text" {
|
||||
const cells: [4]Cell = .{
|
||||
.{ .cp = 'Y', .style = .{ .fg = .green, .bg = .grey, .emphasis = &.{} } },
|
||||
|
||||
Reference in New Issue
Block a user