diff options
author | Alexey Yerin <yyp@disroot.org> | 2021-05-17 22:10:17 +0300 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-05-17 21:22:49 +0200 |
commit | 36f278fab7cf222a050b3e982ef86d1202a7ed0d (patch) | |
tree | 63f9757065c2f939c5e704a2eb99a61a54e8584c /commands.go | |
parent | ui/editor: add boundary checks for word actions (diff) |
commands: ignore empty input
Prior to this, when sending nothing, senpai throws the following
nonsense at you:
"": usage:
Now empty input is ignored, preventing this from appearing
(whitespace-only message should still work).
Diffstat (limited to 'commands.go')
-rw-r--r-- | commands.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/commands.go b/commands.go index fee0571..621b034 100644 --- a/commands.go +++ b/commands.go @@ -350,6 +350,10 @@ func parseCommand(s string) (command, args string) { func (app *App) handleInput(buffer, content string) error { cmdName, rawArgs := parseCommand(content) + if content == "" { + return nil + } + var chosenCMDName string var ok bool for key := range commands { |