Browse Source

reverting main.go to upstream

pull/34/head
David Haukeness 5 years ago
parent
commit
de05697c89
No known key found for this signature in database
GPG Key ID: A7F1091956853EF9
  1. 25
      main.go

25
main.go

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
package main
import (
"flag"
"fmt"
"log"
"os"
"strings"
"time"
@ -40,9 +40,11 @@ func main() { @@ -40,9 +40,11 @@ func main() {
go RunCommand("config", "load")
go populateList()
go updateChatWindow()
// use flag to parse command line arguments
flag.BoolVar(&UNICODE_EMOJI_SUPPORT, "ucode-emoji", false, "Enables unicode emoji printing to screen for supported systems")
flag.Parse()
if len(os.Args) > 1 {
os.Args[0] = "join"
RunCommand(os.Args...)
}
fmt.Println("initKeybindings")
if err := initKeybindings(); err != nil {
fmt.Printf("%+v", err)
@ -270,12 +272,8 @@ func printToView(viewName string, message string) { @@ -270,12 +272,8 @@ func printToView(viewName string, message string) {
updatingView, err := g.View(viewName)
if err != nil {
return err
} else {
if UNICODE_EMOJI_SUPPORT {
message = emojiUnicodeConvert(message)
}
fmt.Fprintf(updatingView, "%s\n", message)
}
fmt.Fprintf(updatingView, "%s\n", message)
return nil
})
}
@ -545,10 +543,6 @@ func deleteEmpty(s []string) []string { @@ -545,10 +543,6 @@ func deleteEmpty(s []string) []string {
func handleInput(viewName string) error {
clearView(viewName)
inputString, _ := getInputString(viewName)
if newViewTitle := getViewTitle(viewName); newViewTitle != "" {
// restore any tab completion view titles on input commit
setViewTitle(viewName, newViewTitle)
}
if inputString == "" {
return nil
}
@ -572,9 +566,12 @@ func handleInput(viewName string) error { @@ -572,9 +566,12 @@ func handleInput(viewName string) error {
cmd[0] = inputString[:1]
RunCommand(cmd...)
} else {
inputString = resolveRootEmojis(inputString)
go sendChat(inputString)
}
// restore any tab completion view titles on input commit
if newViewTitle := getViewTitle(viewName); newViewTitle != "" {
setViewTitle(viewName, newViewTitle)
}
go populateList()
return nil

Loading…
Cancel
Save