From a4e57e17b57c578ce51d2234f0cd84bc8e280c7d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 29 May 2023 17:33:39 -0700 Subject: [PATCH] aider: Added `completions_height` parameter to `InputOutput` class and passed it from `aider/main.py`. # Context: USER: pass it to `InputOutput` and store as a self. var ASSISTANT: I will modify the `InputOutput` class in `aider/io.py` to accept the `completions_height` parameter and store it as an instance variable. Here's the change to add the `completions_height` parameter to the `InputOutput` class: ```python aider/io.py ^C KeyboardInterrupt USER: `aider/io.py` ASSISTANT: I will modify the `InputOutput` class in `aider/io.py` to accept the `completions_height` parameter and store it as an instance variable. Here's the change to add the `completions_height` parameter to the `InputOutput` class: ```python aider/io.py <<<<<<< ORIGINAL def __init__( self, pretty=True, yes=False, input_history_file=None, chat_history_file=None, input=None, output=None, user_input_color="blue", tool_output_color=None, tool_error_color="red", ): ======= def __init__( self, pretty=True, yes=False, input_history_file=None, chat_history_file=None, input=None, output=None, user_input_color="blue", tool_output_color=None, tool_error_color="red", completions_height=10, ): self.completions_height = completions_height >>>>>>> UPDATED ``` Now, you need to pass the `completions_height` value from `aider/main.py` to the `InputOutput` class when creating an instance: ```python aider/main.py <<<<<<< ORIGINAL io = InputOutput( args.pretty, args.yes, args.input_history_file, args.chat_history_file, input=input, output=output, user_input_color=args.user_input_color, tool_output_color=args.tool_output_color, tool_error_color=args.tool_error_color, ) ======= io = InputOutput( args.pretty, args.yes, args.input_history_file, args.chat_history_file, input=input, output=output, user_input_color=args.user_input_color, tool_output_color=args.tool_output_color, tool_error_color=args.tool_error_color, completions_height=args.completions_height, ) >>>>>>> UPDATED ``` Now, the `completions_height` value is passed to the `InputOutput` class and stored as an instance variable. --- aider/io.py | 2 ++ aider/main.py | 1 + 2 files changed, 3 insertions(+) diff --git a/aider/io.py b/aider/io.py index 3bbdca3ed..6af2e8d15 100644 --- a/aider/io.py +++ b/aider/io.py @@ -88,7 +88,9 @@ class InputOutput: user_input_color="blue", tool_output_color=None, tool_error_color="red", + completions_height=10, ): + self.completions_height = completions_height no_color = os.environ.get("NO_COLOR") if no_color is not None and no_color != "": pretty = False diff --git a/aider/main.py b/aider/main.py index 316cfebad..8f4066855 100644 --- a/aider/main.py +++ b/aider/main.py @@ -205,6 +205,7 @@ def main(args=None, input=None, output=None): user_input_color=args.user_input_color, tool_output_color=args.tool_output_color, tool_error_color=args.tool_error_color, + completions_height=args.completions_height, ) if args.verbose: