feat: Row drawing boilerplate.
This commit is contained in:
@@ -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 ***/
|
||||||
|
|||||||
Reference in New Issue
Block a user