From e8ba6825aaf9fc907d6a159862333b8e382ede7b Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 22 Mar 2021 09:12:39 -0400 Subject: [PATCH] Draw tildes --- gilo.go | 6 +++++- internal/editor/editor.go | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gilo.go b/gilo.go index e5a0a83..aba50d8 100644 --- a/gilo.go +++ b/gilo.go @@ -11,7 +11,11 @@ func main() { defer terminal.RawOff(oldState) // The input loop - for editor.ProcessKeypress() { + for { editor.RefreshScreen() + + if editor.ProcessKeypress() == false { + break + } } } diff --git a/internal/editor/editor.go b/internal/editor/editor.go index b7c10cb..6c5f9cd 100644 --- a/internal/editor/editor.go +++ b/internal/editor/editor.go @@ -19,9 +19,19 @@ func readKey() (rune, int) { return ch, size } +func drawRows() { + for y :=0; y < 24; y += 1 { + terminal.OutLn("~") + } +} + func RefreshScreen() { terminal.ANSICode(terminal.ClearScreen) terminal.ANSICode(terminal.ResetCursor) + + drawRows() + + terminal.ANSICode(terminal.ResetCursor) } func ProcessKeypress() bool {