From 4cbdb9b9ada9e3ef4db7b67b6e204a24c4eafcca Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 18 May 2023 09:54:54 -0700 Subject: [PATCH] Added a method to check if input is a command. --- aider/coder.py | 2 +- aider/commands.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/aider/coder.py b/aider/coder.py index 05c2a4a64..71d178099 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -228,7 +228,7 @@ class Coder: if not inp: return - if inp.startswith("/"): + if self.commands.is_command(inp): return self.commands.run(inp) return self.send_new_user_message(inp) diff --git a/aider/commands.py b/aider/commands.py index 4725602db..b5ccffbef 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -10,6 +10,10 @@ class Commands: self.io = io self.coder = coder + def is_command(self, inp): + if inp[0] == '/': + return True + def help(self): "Show help about all commands" commands = self.get_commands()