From 1af11f1b8f3b4a48016321ec952571c2c593b397 Mon Sep 17 00:00:00 2001 From: sloumdrone Date: Sun, 15 Sep 2019 21:26:32 -0700 Subject: [PATCH] Removes duplicated code in messaging system --- client.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/client.go b/client.go index e0abfa6..3aba883 100644 --- a/client.go +++ b/client.go @@ -563,23 +563,8 @@ func (c *client) SetMessage(msg string, isError bool) { } func (c *client) DrawMessage() { - leadIn, leadOut := "", "" - if c.Options["theme"] == "normal" { - leadIn = "\033[7m" - leadOut = "\033[0m" - } - - if c.MessageIsErr { - leadIn = "\033[31;1m" - leadOut = "\033[0m" - - if c.Options["theme"] == "normal" { - leadIn = "\033[41;1;7m" - } - } - cui.MoveCursorTo(c.Height-1, 0) - fmt.Printf("%s%-*.*s%s", leadIn, c.Width, c.Width, c.Message, leadOut) + fmt.Print(c.RenderMessage()) } func (c *client) RenderMessage() string {