gilo/gilo.go

22 lines
355 B
Go
Raw Normal View History

2021-03-18 16:30:04 -04:00
package main
import (
2021-03-19 17:03:56 -04:00
"timshome.page/gilo/internal/editor"
2021-03-19 16:39:49 -04:00
"timshome.page/gilo/internal/terminal"
2021-03-18 16:30:04 -04:00
)
2021-03-19 12:46:43 -04:00
func main() {
2021-03-19 16:39:49 -04:00
// Go to proper raw mode, but restore canonical mode at exit
oldState := terminal.RawOn()
defer terminal.RawOff(oldState)
2021-03-18 19:15:19 -04:00
2021-03-19 17:39:15 -04:00
// The input loop
2021-03-22 09:12:39 -04:00
for {
2021-03-19 17:39:15 -04:00
editor.RefreshScreen()
2021-03-22 09:12:39 -04:00
if editor.ProcessKeypress() == false {
break
}
2021-03-18 19:15:19 -04:00
}
2021-03-18 16:30:04 -04:00
}