Commit f7aa3ba

mo khan <mo.khan@gmail.com>
2021-01-22 03:35:19
draw tildas
1 parent 456d2a0
Changed files (1)
kilo.c
@@ -56,6 +56,12 @@ char editor_read_key() {
 
 /*** output ***/
 
+void editor_draw_rows() {
+  for (int i = 0; i < 24; i++) {
+    write(STDOUT_FILENO, "~\r\n", 3);
+  }
+}
+
 void editor_refresh_screen() {
   // <esc>[0J clear screen from cursor up
   // <esc>[1J clear screen up to cursor
@@ -63,6 +69,8 @@ void editor_refresh_screen() {
   write(STDOUT_FILENO, "\x1b[2J", 4);
   // reposition cursor at the top-left corner
   write(STDOUT_FILENO, "\x1b[H", 3); // https://vt100.net/docs/vt100-ug/chapter3.html#CUP
+  editor_draw_rows();
+  write(STDOUT_FILENO, "\x1b[H", 3);
 }
 
 /*** input ***/