Draw tildes
This commit is contained in:
parent
94426483c6
commit
e8ba6825aa
6
gilo.go
6
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user