From 3537880242401af897277c20cb92fb2da7cf8225 Mon Sep 17 00:00:00 2001 From: sloumdrone Date: Sat, 12 Oct 2019 11:48:16 -0700 Subject: [PATCH] Corrected lexer commands --- client.go | 11 +++++++++-- cmdparse/lexer.go | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 5625bf5..71b998d 100644 --- a/client.go +++ b/client.go @@ -289,8 +289,15 @@ func (c *client) simpleCommand(action string) { case "B", "BOOKMARKS": c.BookMarks.ToggleOpen() c.Draw() - case "R", "REFRESH": - // TODO build refresh code + case "R", "RELOAD": + c.ClearMessage() + err := c.ReloadPage() + if err != nil { + c.SetMessage(err.Error(), false) + c.DrawMessage() + } else { + c.Draw() + } case "SEARCH": c.search("", "", "?") case "HELP", "?": diff --git a/cmdparse/lexer.go b/cmdparse/lexer.go index 529bb2a..f61bf4c 100644 --- a/cmdparse/lexer.go +++ b/cmdparse/lexer.go @@ -69,7 +69,7 @@ func (s *scanner) scanText() Token { capInput := strings.ToUpper(buf.String()) switch capInput { case "D", "DELETE", "A", "ADD","W", "WRITE", - "S", "SET", "R", "REFRESH", "SEARCH", + "S", "SET", "R", "RELOAD", "SEARCH", "Q", "QUIT", "B", "BOOKMARKS", "H", "HOME", "?", "HELP", "C", "CHECK", "P", "PURGE":