Draw tildes

This commit is contained in:
Timothy Warren 2021-03-22 09:12:39 -04:00
parent 94426483c6
commit e8ba6825aa
2 changed files with 15 additions and 1 deletions

View File

@ -11,7 +11,11 @@ func main() {
defer terminal.RawOff(oldState)
// The input loop
for editor.ProcessKeypress() {
for {
editor.RefreshScreen()
if editor.ProcessKeypress() == false {
break
}
}
}

View File

@ -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 {