this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

resize: properly handle state reset on primary screen

When drawing on the primary screen The internal state of the cursor
location was not being updated. This resulted in an invalid state and a
messed up screen

Fixes: https://github.com/rockorager/libvaxis/issues/63

+4 -5
+4 -5
src/Vaxis.zig
··· 180 180 if (self.state.alt_screen) 181 181 try tty.writeAll(ctlseqs.home) 182 182 else { 183 + try tty.writeBytesNTimes(ctlseqs.ri, self.state.cursor.row); 183 184 try tty.writeByte('\r'); 184 - var i: usize = 0; 185 - while (i < self.state.cursor.row) : (i += 1) { 186 - try tty.writeAll(ctlseqs.ri); 187 - } 188 185 } 186 + self.state.cursor.row = 0; 187 + self.state.cursor.col = 0; 189 188 try tty.writeAll(ctlseqs.sgr_reset ++ ctlseqs.erase_below_cursor); 190 189 } 191 190 ··· 401 400 if (n > 0) 402 401 try tty.print(ctlseqs.cuf, .{n}); 403 402 } else { 404 - try tty.writeByte('\r'); 405 403 const n = row - cursor_pos.row; 406 404 try tty.writeByteNTimes('\n', n); 405 + try tty.writeByte('\r'); 407 406 if (col > 0) 408 407 try tty.print(ctlseqs.cuf, .{col}); 409 408 }