From be87ff0193057fa2cd77a548c29c9b5ec25addf6 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 22 Mar 2025 18:33:50 -0700 Subject: [PATCH] feat: Set placeholder with args in /context command --- aider/commands.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index 722a06951..fe0d7f8b4 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1167,12 +1167,22 @@ class Commands: user_msg = args coder.run(user_msg) - raise SwitchCoder( - edit_format=self.coder.edit_format, - summarize_from_coder=False, - from_coder=coder, - show_announcements=False, - ) + # When using context command, set the placeholder to the args + if edit_format == "context" and args.strip(): + raise SwitchCoder( + edit_format=self.coder.edit_format, + summarize_from_coder=False, + from_coder=coder, + show_announcements=False, + placeholder=args, + ) + else: + raise SwitchCoder( + edit_format=self.coder.edit_format, + summarize_from_coder=False, + from_coder=coder, + show_announcements=False, + ) def get_help_md(self): "Show help about all commands in markdown"