)
const (
- synLinesUp = 75 // How many lines up to look to do syntax highlighting
- synLinesDown = 75 // How many lines down to look to do syntax highlighting
doubleClickThreshold = 400 // How many milliseconds to wait before a second click is not a double click
undoThreshold = 500 // If two events are less than n milliseconds apart, undo both of them
autosaveTime = 8 // Number of seconds to wait before autosaving
screen, err = tcell.NewScreen()
if err != nil {
fmt.Println(err)
+ if err == tcell.ErrTermNotFound {
+ fmt.Println("Micro does not recognize your terminal:", oldTerm)
+ fmt.Println("Please go to https://github.com/zyedidia/mkinfo to read about how to fix this problem (it should be easy to fix).")
+ }
os.Exit(1)
}
if err = screen.Init(); err != nil {
flag.Usage = func() {
fmt.Println("Usage: micro [OPTIONS] [FILE]...")
fmt.Print("Micro's options can be set via command line arguments for quick adjustments. For real configuration, please use the bindings.json file (see 'help options').\n\n")
+ flag.CommandLine.SetOutput(os.Stdout)
flag.PrintDefaults()
}
// This is used for sending the user messages in the bottom of the editor
messenger = new(Messenger)
messenger.history = make(map[string][]string)
- InitColorscheme()
// Now we load the input
buffers := LoadInput()
}
}
+ InitColorscheme()
+
// Here is the event loop which runs in a separate thread
go func() {
for {
- events <- screen.PollEvent()
+ if screen != nil {
+ events <- screen.PollEvent()
+ }
}
}()