terminal: cursors must set pending wrap

This commit is contained in:
Mitchell Hashimoto
2023-09-25 17:42:37 -07:00
parent 2c26071332
commit 3f48a43ba4

View File

@ -1356,9 +1356,9 @@ pub fn cursorLeft(self: *Terminal, count: usize) void {
const tracy = trace(@src()); const tracy = trace(@src());
defer tracy.end(); defer tracy.end();
// TODO: scroll region, wrap // TODO: scroll region
self.screen.cursor.x -|= if (count == 0) 1 else count; self.screen.cursor.x -|= if (count == 0) 1 else count;
self.screen.cursor.pending_wrap = false;
} }
/// Move the cursor right amount columns. If amount is greater than the /// Move the cursor right amount columns. If amount is greater than the
@ -1385,6 +1385,7 @@ pub fn cursorDown(self: *Terminal, count: usize) void {
const tracy = trace(@src()); const tracy = trace(@src());
defer tracy.end(); defer tracy.end();
self.screen.cursor.pending_wrap = false;
self.screen.cursor.y += if (count == 0) 1 else count; self.screen.cursor.y += if (count == 0) 1 else count;
if (self.screen.cursor.y >= self.rows) { if (self.screen.cursor.y >= self.rows) {
self.screen.cursor.y = self.rows - 1; self.screen.cursor.y = self.rows - 1;