mirror of
https://github.com/EnumeratedDev/Typer.git
synced 2025-07-01 07:48:20 +00:00
51 lines
715 B
Go
51 lines
715 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
var sysconfdir = "/etc/"
|
|
|
|
func main() {
|
|
// Read config
|
|
readConfig()
|
|
|
|
// Read key bindings
|
|
readKeybindings()
|
|
|
|
// Read styles
|
|
readStyles()
|
|
|
|
// Initialize commands
|
|
initCommands()
|
|
|
|
window, err := CreateWindow()
|
|
if err != nil {
|
|
log.Fatalf("Failed to create window: %v", err)
|
|
}
|
|
|
|
if len(os.Args) > 1 {
|
|
for i, file := range os.Args[1:] {
|
|
b, err := CreateFileBuffer(file, true)
|
|
if err != nil {
|
|
PrintMessage(window, "Could not open file: "+file)
|
|
continue
|
|
}
|
|
|
|
if i == 0 {
|
|
window.CurrentBuffer = b
|
|
Buffers = Buffers[1:]
|
|
}
|
|
}
|
|
}
|
|
|
|
for !window.closed {
|
|
window.Draw()
|
|
window.ProcessEvents()
|
|
}
|
|
|
|
window.screen.Fini()
|
|
window.screen = nil
|
|
}
|