refactor: zigify imports and correct minor mistakes
This commit is contained in:
@@ -1,11 +1,3 @@
|
||||
const std = @import("std");
|
||||
const zterm = @import("zterm");
|
||||
|
||||
const input = zterm.input;
|
||||
const App = zterm.App(union(enum) {});
|
||||
|
||||
const log = std.log.scoped(.default);
|
||||
|
||||
const QuitText = struct {
|
||||
const text = "Press ctrl+c to quit. Press ctrl+n to launch helix.";
|
||||
|
||||
@@ -158,6 +150,7 @@ pub fn main() !void {
|
||||
|
||||
if (key.eql(.{ .cp = 'n', .mod = .{ .ctrl = true } })) {
|
||||
try app.interrupt();
|
||||
renderer.size = .{}; // reset size, such that next resize will cause a full re-draw!
|
||||
defer app.start() catch @panic("could not start app event loop");
|
||||
var child = std.process.Child.init(&.{"hx"}, allocator);
|
||||
_ = child.spawnAndWait() catch |err| app.postEvent(.{
|
||||
@@ -188,10 +181,16 @@ pub fn main() !void {
|
||||
else => {},
|
||||
}
|
||||
|
||||
try renderer.resize();
|
||||
container.resize(renderer.size);
|
||||
container.resize(try renderer.resize());
|
||||
container.reposition(.{});
|
||||
try renderer.render(@TypeOf(container), &container);
|
||||
try renderer.flush();
|
||||
}
|
||||
}
|
||||
|
||||
const log = std.log.scoped(.default);
|
||||
|
||||
const std = @import("std");
|
||||
const zterm = @import("zterm");
|
||||
const input = zterm.input;
|
||||
const App = zterm.App(union(enum) {});
|
||||
|
||||
Reference in New Issue
Block a user