diff options
author | Nguyễn Gia Phong <cnx@loang.net> | 2025-07-23 17:05:59 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <cnx@loang.net> | 2025-07-23 17:06:58 +0900 |
commit | 366fa5128ae8398bb31ecfbbc5d9251dd785ba28 (patch) | |
tree | 2cd458133d76ad077d75e3aae5ad21a037bdfae7 /src/main.zig | |
parent | a45f2cfa8c0425ddc6738deba8b5c09e8c964a07 (diff) | |
download | kay-main.tar.gz |
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig index cf99cad..5e91719 100644 --- a/src/main.zig +++ b/src/main.zig @@ -17,7 +17,9 @@ const Unicode = vaxis.Unicode; const Winsize = vaxis.Winsize; const gwidth = vaxis.gwidth.gwidth; const vaxis = @import("vaxis"); +const zsanett = @import("zsanett"); +const Config = @import("Config.zig"); const Token = @import("Token.zig"); const languages = @import("languages"); @@ -34,6 +36,11 @@ pub fn main() !void { .ReleaseFast, .ReleaseSmall => smp_allocator, }; + zsanett.init(); + defer zsanett.deinit(); + const janet_env = zsanett.coreEnv(null); + const config = try Config.parse(allocator, janet_env); + var tty = try Tty.init(); defer tty.deinit(); var vx = try vaxis.init(allocator, .{}); @@ -77,10 +84,10 @@ pub fn main() !void { continue; } const width: u8 = if (eql(u8, bytes, "\t")) - 8 // TODO: make configurable + config.tab_width else @intCast(gwidth(bytes, vx.caps.unicode, - &vx.unicode.width_data)); + &vx.unicode.width_data)); defer col += width; window.writeCell(col, row, .{ .char = .{ .grapheme = bytes, .width = width }, |