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 {