feat: Row drawing boilerplate.

This commit is contained in:
jmug
2026-10-09 18:03:51 -07:00
parent 7dc05fce1d
commit 07882d8ba5
+10
View File
@@ -65,11 +65,21 @@ char editorReadKey() {
/*** output ***/ /*** output ***/
void editorDrawRows() {
for (int y = 0; y < 24; y++) {
write(STDOUT_FILENO, "~\r\n", 3);
}
}
void editorRefreshScreen() { void editorRefreshScreen() {
// Clear the whole screen. // Clear the whole screen.
write(STDOUT_FILENO, "\x1b[2J", 4); write(STDOUT_FILENO, "\x1b[2J", 4);
// Move cursor to top left. // Move cursor to top left.
write(STDOUT_FILENO, "\x1b[H", 3); write(STDOUT_FILENO, "\x1b[H", 3);
editorDrawRows();
write(STDOUT_FILENO, "\x1b[H", 3);
} }
/*** input ***/ /*** input ***/