jank wrap handling (by not wrapping at all)

This commit is contained in:
Mitchell Hashimoto
2022-04-28 21:40:10 -07:00
parent 19a0b874f2
commit 0c417027ef

View File

@ -114,7 +114,7 @@ pub fn append(self: *Terminal, alloc: Allocator, str: []const u8) !void {
///
/// This may allocate if necessary to store the character in the grid.
pub fn appendChar(self: *Terminal, alloc: Allocator, c: u8) !void {
log.debug("char: {}", .{c});
//log.debug("char: {}", .{c});
const actions = self.parser.next(c);
for (actions) |action_opt| {
switch (action_opt orelse continue) {
@ -133,6 +133,11 @@ fn print(self: *Terminal, alloc: Allocator, c: u8) !void {
// Move the cursor
self.cursor.x += 1;
// TODO: wrap
if (self.cursor.x == self.cols) {
self.cursor.x -= 1;
}
}
fn execute(self: *Terminal, alloc: Allocator, c: u8) !void {