feat: Row drawing boilerplate.
This commit is contained in:
@@ -65,11 +65,21 @@ char editorReadKey() {
|
||||
|
||||
/*** output ***/
|
||||
|
||||
void editorDrawRows() {
|
||||
for (int y = 0; y < 24; y++) {
|
||||
write(STDOUT_FILENO, "~\r\n", 3);
|
||||
}
|
||||
}
|
||||
|
||||
void editorRefreshScreen() {
|
||||
// Clear the whole screen.
|
||||
write(STDOUT_FILENO, "\x1b[2J", 4);
|
||||
// Move cursor to top left.
|
||||
write(STDOUT_FILENO, "\x1b[H", 3);
|
||||
|
||||
editorDrawRows();
|
||||
|
||||
write(STDOUT_FILENO, "\x1b[H", 3);
|
||||
}
|
||||
|
||||
/*** input ***/
|
||||
|
||||
Reference in New Issue
Block a user