From de05697c8937957b80c6b6140de83817c23e0b4a Mon Sep 17 00:00:00 2001 From: David Haukeness Date: Sat, 26 Oct 2019 13:32:02 -0600 Subject: [PATCH] reverting main.go to upstream --- main.go | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/main.go b/main.go index 2ada8f8..27d9f95 100644 --- a/main.go +++ b/main.go @@ -1,9 +1,9 @@ package main import ( - "flag" "fmt" "log" + "os" "strings" "time" @@ -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) { 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 { 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 { 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