From 2c084d65d9a58a50f043aefbc8b1bdd7034e04a2 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:41:51 -0700 Subject: [PATCH 01/21] refactor: centralize style creation logic by introducing _get_style method in InputOutput class --- aider/io.py | 67 +++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/aider/io.py b/aider/io.py index a71c91469..8529ef450 100644 --- a/aider/io.py +++ b/aider/io.py @@ -251,6 +251,16 @@ class InputOutput: else: self.console = Console(force_terminal=False, no_color=True) # non-pretty + def _get_style(self, style_dict=None): + if self.pretty and self.user_input_color: + if style_dict is None: + style_dict = {"": self.user_input_color} + else: + style_dict.setdefault("", self.user_input_color) + return Style.from_dict(style_dict) + else: + return None + def read_image(self, filename): try: with open(str(filename), "rb") as image_file: @@ -328,22 +338,17 @@ class InputOutput: inp = "" multiline_input = False - if self.user_input_color and self.pretty: - style = Style.from_dict( - { - "": self.user_input_color, - "pygments.literal.string": f"bold italic {self.user_input_color}", - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" - ), - } - ) - else: - style = None + style_dict = { + "pygments.literal.string": f"bold italic {self.user_input_color}", + "completion-menu": ( + f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" + ), + "completion-menu.completion.current": ( + f"bg:{self.completion_menu_current_bg_color} " + f"{self.completion_menu_current_color}" + ), + } + style = self._get_style(style_dict) completer_instance = ThreadedCompleter( AutoCompleter( @@ -483,19 +488,18 @@ class InputOutput: else: self.tool_output(subject, bold=True) - if self.pretty and self.user_input_color: - style = { - "": self.user_input_color, - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" - ), - } - else: - style = dict() + style_dict = { + "completion-menu": ( + f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" + ), + "completion-menu.completion.current": ( + f"bg:{self.completion_menu_current_bg_color} " + f"{self.completion_menu_current_color}" + ), + } + style = self._get_style(style_dict) + if style is None: + style = {} def is_valid_response(text): if not text: @@ -558,10 +562,7 @@ class InputOutput: self.tool_output() self.tool_output(subject, bold=True) - if self.pretty and self.user_input_color: - style = Style.from_dict({"": self.user_input_color}) - else: - style = None + style = self._get_style() if self.yes is True: res = "yes" From cf46d9cdd03248034c1960e701f450219d7601c8 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:41:56 -0700 Subject: [PATCH 02/21] style: run linter and format completion menu style definitions --- aider/io.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/aider/io.py b/aider/io.py index 8529ef450..a26c2fa72 100644 --- a/aider/io.py +++ b/aider/io.py @@ -340,12 +340,9 @@ class InputOutput: style_dict = { "pygments.literal.string": f"bold italic {self.user_input_color}", - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), + "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" + f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" ), } style = self._get_style(style_dict) @@ -489,12 +486,9 @@ class InputOutput: self.tool_output(subject, bold=True) style_dict = { - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), + "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" + f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" ), } style = self._get_style(style_dict) From bff1b3de9c690d201a1f972ff56c77e9dba5dffd Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:43:12 -0700 Subject: [PATCH 03/21] refactor: centralize completion menu styles in _get_style method to reduce code duplication --- aider/io.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/aider/io.py b/aider/io.py index a26c2fa72..5069c9334 100644 --- a/aider/io.py +++ b/aider/io.py @@ -257,6 +257,13 @@ class InputOutput: style_dict = {"": self.user_input_color} else: style_dict.setdefault("", self.user_input_color) + # Add the completion menu styles + style_dict.update({ + "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", + "completion-menu.completion.current": ( + f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" + ), + }) return Style.from_dict(style_dict) else: return None @@ -340,10 +347,6 @@ class InputOutput: style_dict = { "pygments.literal.string": f"bold italic {self.user_input_color}", - "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" - ), } style = self._get_style(style_dict) @@ -485,13 +488,7 @@ class InputOutput: else: self.tool_output(subject, bold=True) - style_dict = { - "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" - ), - } - style = self._get_style(style_dict) + style = self._get_style() if style is None: style = {} From 0a558682d833be8d5c38ca426861805a6e023497 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:43:16 -0700 Subject: [PATCH 04/21] style: format linter adjustments in io.py for better readability --- aider/io.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aider/io.py b/aider/io.py index 5069c9334..2c78686ce 100644 --- a/aider/io.py +++ b/aider/io.py @@ -258,12 +258,16 @@ class InputOutput: else: style_dict.setdefault("", self.user_input_color) # Add the completion menu styles - style_dict.update({ - "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" - ), - }) + style_dict.update( + { + "completion-menu": ( + f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" + ), + "completion-menu.completion.current": ( + f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" + ), + } + ) return Style.from_dict(style_dict) else: return None From b16050211c4d063d0d934b608ad1f51797e49420 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:43:30 -0700 Subject: [PATCH 05/21] fix: fix line length issue in _get_style method by breaking long string into multiple lines --- aider/io.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aider/io.py b/aider/io.py index 2c78686ce..7cac9f962 100644 --- a/aider/io.py +++ b/aider/io.py @@ -264,8 +264,9 @@ class InputOutput: f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" ), "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" - ), + f"bg:{self.completion_menu_current_bg_color} " + f"{self.completion_menu_current_color}" + ) } ) return Style.from_dict(style_dict) From 1cd5b11b5c6afc692f4b1a1eec5daee7805774e7 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:43:34 -0700 Subject: [PATCH 06/21] style: fix linter issues in io.py --- aider/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 7cac9f962..57657adb5 100644 --- a/aider/io.py +++ b/aider/io.py @@ -266,7 +266,7 @@ class InputOutput: "completion-menu.completion.current": ( f"bg:{self.completion_menu_current_bg_color} " f"{self.completion_menu_current_color}" - ) + ), } ) return Style.from_dict(style_dict) From d2e0d3c06d50ceb2f268fd44bb46c7664a590977 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:44:14 -0700 Subject: [PATCH 07/21] refactor: ensure _get_style always returns a dictionary and simplify calling code --- aider/io.py | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/aider/io.py b/aider/io.py index 57657adb5..ff4121d84 100644 --- a/aider/io.py +++ b/aider/io.py @@ -252,26 +252,19 @@ class InputOutput: self.console = Console(force_terminal=False, no_color=True) # non-pretty def _get_style(self, style_dict=None): + if style_dict is None: + style_dict = {} if self.pretty and self.user_input_color: - if style_dict is None: - style_dict = {"": self.user_input_color} - else: - style_dict.setdefault("", self.user_input_color) - # Add the completion menu styles - style_dict.update( - { - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" - ), - } - ) + style_dict.setdefault("", self.user_input_color) + style_dict.update({ + "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", + "completion-menu.completion.current": ( + f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" + ), + }) return Style.from_dict(style_dict) else: - return None + return {} def read_image(self, filename): try: @@ -494,8 +487,6 @@ class InputOutput: self.tool_output(subject, bold=True) style = self._get_style() - if style is None: - style = {} def is_valid_response(text): if not text: From c5fb25eec315953a8fcd9c73af9033a4a67cdf86 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:44:20 -0700 Subject: [PATCH 08/21] fix: correct SEARCH/REPLACE block in aider/io.py to match existing lines exactly --- aider/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index ff4121d84..494e888fd 100644 --- a/aider/io.py +++ b/aider/io.py @@ -505,7 +505,7 @@ class InputOutput: if self.prompt_session: res = self.prompt_session.prompt( question, - style=Style.from_dict(style), + style=style, ) else: res = input(question) From fd9dc9e8d24a9c3ed0d1fcabad1b5c5ce4d8a2ab Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:44:23 -0700 Subject: [PATCH 09/21] style: format linter adjustments in io.py for better readability --- aider/io.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aider/io.py b/aider/io.py index 494e888fd..d0aceed90 100644 --- a/aider/io.py +++ b/aider/io.py @@ -256,12 +256,16 @@ class InputOutput: style_dict = {} if self.pretty and self.user_input_color: style_dict.setdefault("", self.user_input_color) - style_dict.update({ - "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" - ), - }) + style_dict.update( + { + "completion-menu": ( + f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" + ), + "completion-menu.completion.current": ( + f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" + ), + } + ) return Style.from_dict(style_dict) else: return {} From 725b5f70631f7b79e5f9be38a4a0e221458405af Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:45:04 -0700 Subject: [PATCH 10/21] feat: centralize pygments.literal.string style configuration in _get_style method and simplify calling code --- aider/io.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/aider/io.py b/aider/io.py index d0aceed90..09256feeb 100644 --- a/aider/io.py +++ b/aider/io.py @@ -258,6 +258,7 @@ class InputOutput: style_dict.setdefault("", self.user_input_color) style_dict.update( { + "pygments.literal.string": f"bold italic {self.user_input_color}", "completion-menu": ( f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" ), @@ -347,10 +348,7 @@ class InputOutput: inp = "" multiline_input = False - style_dict = { - "pygments.literal.string": f"bold italic {self.user_input_color}", - } - style = self._get_style(style_dict) + style = self._get_style() completer_instance = ThreadedCompleter( AutoCompleter( From d3908ca971311653de4e32bc45f46e9d9997f5fc Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:45:14 -0700 Subject: [PATCH 11/21] fix: update style dictionary and simplify style retrieval in get_input method --- aider/io.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 09256feeb..3dc0c352d 100644 --- a/aider/io.py +++ b/aider/io.py @@ -263,7 +263,8 @@ class InputOutput: f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" ), "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}" + f"bg:{self.completion_menu_current_bg_color} " + f"{self.completion_menu_current_color}" ), } ) From ede3cbb372612e7bbf75352cf5eecca8c59ae3fd Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 27 Sep 2024 19:47:40 -0700 Subject: [PATCH 12/21] refactor: simplify _get_style method in InputOutput class --- aider/io.py | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/aider/io.py b/aider/io.py index 3dc0c352d..6583737ff 100644 --- a/aider/io.py +++ b/aider/io.py @@ -251,26 +251,32 @@ class InputOutput: else: self.console = Console(force_terminal=False, no_color=True) # non-pretty - def _get_style(self, style_dict=None): - if style_dict is None: - style_dict = {} - if self.pretty and self.user_input_color: + def _get_style(self): + style_dict = {} + if not self.pretty: + return Style.from_dict(style_dict) + + if self.user_input_color: style_dict.setdefault("", self.user_input_color) style_dict.update( { "pygments.literal.string": f"bold italic {self.user_input_color}", - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" - ), } ) - return Style.from_dict(style_dict) - else: - return {} + + style_dict.update( + { + "completion-menu": ( + f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" + ), + "completion-menu.completion.current": ( + f"bg:{self.completion_menu_current_bg_color} " + f"{self.completion_menu_current_color}" + ), + } + ) + + return Style.from_dict(style_dict) def read_image(self, filename): try: From 537f5a1f98cbe3ffc85d05f706dcc2380c3789fc Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:47:41 -0700 Subject: [PATCH 13/21] fix: update _get_style method to conditionally add completion menu styles based on non-null values --- aider/io.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/aider/io.py b/aider/io.py index 6583737ff..9316180de 100644 --- a/aider/io.py +++ b/aider/io.py @@ -264,17 +264,23 @@ class InputOutput: } ) - style_dict.update( - { - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" - ), - } - ) + # Conditionally add 'completion-menu' style + completion_menu_style = [] + if self.completion_menu_bg_color: + completion_menu_style.append(f"bg:{self.completion_menu_bg_color}") + if self.completion_menu_color: + completion_menu_style.append(self.completion_menu_color) + if completion_menu_style: + style_dict["completion-menu"] = " ".join(completion_menu_style) + + # Conditionally add 'completion-menu.completion.current' style + completion_menu_current_style = [] + if self.completion_menu_current_bg_color: + completion_menu_current_style.append(f"bg:{self.completion_menu_current_bg_color}") + if self.completion_menu_current_color: + completion_menu_current_style.append(self.completion_menu_current_color) + if completion_menu_current_style: + style_dict["completion-menu.completion.current"] = " ".join(completion_menu_current_style) return Style.from_dict(style_dict) From 2d5db0dc235e3ce546aba454dde1569c61d283fa Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:47:45 -0700 Subject: [PATCH 14/21] style: format code with linter adjustments --- aider/io.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 9316180de..c7148f6cf 100644 --- a/aider/io.py +++ b/aider/io.py @@ -280,7 +280,9 @@ class InputOutput: if self.completion_menu_current_color: completion_menu_current_style.append(self.completion_menu_current_color) if completion_menu_current_style: - style_dict["completion-menu.completion.current"] = " ".join(completion_menu_current_style) + style_dict["completion-menu.completion.current"] = " ".join( + completion_menu_current_style + ) return Style.from_dict(style_dict) From e465cda5c88d349a0caeb426fb5b624078984b2a Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:49:17 -0700 Subject: [PATCH 15/21] fix: change default values for completion menu arguments from "default" to None in aider/args.py --- aider/args.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aider/args.py b/aider/args.py index 9be32e44a..a5b36e6dc 100644 --- a/aider/args.py +++ b/aider/args.py @@ -375,13 +375,13 @@ def get_parser(default_config_files, git_root): group.add_argument( "--completion-menu-color", metavar="COLOR", - default="default", + default=None, help="Set the color for the completion menu (default: terminal's default text color)", ) group.add_argument( "--completion-menu-bg-color", metavar="COLOR", - default="default", + default=None, help=( "Set the background color for the completion menu (default: terminal's default" " background color)" @@ -390,7 +390,7 @@ def get_parser(default_config_files, git_root): group.add_argument( "--completion-menu-current-color", metavar="COLOR", - default="default", + default=None, help=( "Set the color for the current item in the completion menu (default: terminal's default" " background color)" @@ -399,7 +399,7 @@ def get_parser(default_config_files, git_root): group.add_argument( "--completion-menu-current-bg-color", metavar="COLOR", - default="default", + default=None, help=( "Set the background color for the current item in the completion menu (default:" " terminal's default text color)" From 3ff5f280bb648ee3e1ee4654edfa6407f51946ad Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 27 Sep 2024 19:49:52 -0700 Subject: [PATCH 16/21] fix: add dump function call to style dictionary processing in InputOutput class --- aider/io.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aider/io.py b/aider/io.py index c7148f6cf..a98e470b0 100644 --- a/aider/io.py +++ b/aider/io.py @@ -284,6 +284,7 @@ class InputOutput: completion_menu_current_style ) + dump(style_dict) return Style.from_dict(style_dict) def read_image(self, filename): From 1a75b79c81d73b96e2fb3082c588d043c91add57 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 19:49:53 -0700 Subject: [PATCH 17/21] fix: change default values for completion menu arguments to None in InputOutput.__init__ method --- aider/io.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aider/io.py b/aider/io.py index a98e470b0..f1d3f63e1 100644 --- a/aider/io.py +++ b/aider/io.py @@ -181,10 +181,10 @@ class InputOutput: tool_error_color="red", tool_warning_color="#FFA500", assistant_output_color="blue", - completion_menu_color="default", - completion_menu_bg_color="default", - completion_menu_current_color="default", - completion_menu_current_bg_color="default", + completion_menu_color=None, + completion_menu_bg_color=None, + completion_menu_current_color=None, + completion_menu_current_bg_color=None, code_theme="default", encoding="utf-8", dry_run=False, From 91307ecfc4204994426d8cc84d72841bc16cba18 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 27 Sep 2024 19:50:45 -0700 Subject: [PATCH 18/21] fix: Remove unnecessary call to dump() in InputOutput.read_style() --- aider/io.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index f1d3f63e1..242df7917 100644 --- a/aider/io.py +++ b/aider/io.py @@ -284,7 +284,6 @@ class InputOutput: completion_menu_current_style ) - dump(style_dict) return Style.from_dict(style_dict) def read_image(self, filename): From d7d87847a6ba62a4886fe2f99547dad71495b37c Mon Sep 17 00:00:00 2001 From: fry69 <142489379+fry69@users.noreply.github.com> Date: Sat, 28 Sep 2024 08:29:10 +0200 Subject: [PATCH 19/21] doc: small fixes --- CONTRIBUTING.md | 4 ++++ aider/commands.py | 2 +- aider/website/docs/faq.md | 13 +++++++++++-- aider/website/docs/usage/commands.md | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 441c946fd..70f5a5ba2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -154,6 +154,10 @@ The project's documentation is built using Jekyll and hosted on GitHub Pages. To ``` bundle exec jekyll build ``` +5. Preview the website while editing (optional): + ``` + bundle exec jekyll serve + ``` The built documentation will be available in the `aider/website/_site` directory. diff --git a/aider/commands.py b/aider/commands.py index 74a0dd956..977aeba06 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -735,7 +735,7 @@ class Commands: self.io.tool_output(f"Removed {matched_file} from the chat") def cmd_git(self, args): - "Run a git command" + "Run a git command (output excluded from chat)" combined_output = None try: args = "git " + args diff --git a/aider/website/docs/faq.md b/aider/website/docs/faq.md index 4cd95de74..c120d2ddd 100644 --- a/aider/website/docs/faq.md +++ b/aider/website/docs/faq.md @@ -124,6 +124,9 @@ When starting a fresh aider session, you can include recent git history in the c Remember, the chat history already includes recent changes made during the current session, so this tip is most useful when starting a new aider session and you want to provide context about recent work. +{: .tip } +The `/git` command will not work for this purpose, as its output is not included in the chat. + ## How can I run aider locally from source code? To run the project locally, follow these steps: @@ -194,12 +197,18 @@ Yes, you can now share aider chat logs in a pretty way. 1. Copy the markdown logs you want to share from `.aider.chat.history.md` and make a github gist. Or publish the raw markdown logs on the web any way you'd like. -https://gist.github.com/paul-gauthier/2087ab8b64034a078c0a209440ac8be0 + ``` + https://gist.github.com/paul-gauthier/2087ab8b64034a078c0a209440ac8be0 + ``` 2. Take the gist URL and append it to: -https://aider.chat/share/?mdurl= + ``` + https://aider.chat/share/?mdurl= + ``` This will give you a URL like this, which shows the chat history like you'd see in a terminal: +``` https://aider.chat/share/?mdurl=https://gist.github.com/paul-gauthier/2087ab8b64034a078c0a209440ac8be0 +``` diff --git a/aider/website/docs/usage/commands.md b/aider/website/docs/usage/commands.md index cbdfc4f7c..20456ecc7 100644 --- a/aider/website/docs/usage/commands.md +++ b/aider/website/docs/usage/commands.md @@ -25,7 +25,7 @@ cog.out(get_help_md()) | **/diff** | Display the diff of changes since the last message | | **/drop** | Remove files from the chat session to free up context space | | **/exit** | Exit the application | -| **/git** | Run a git command | +| **/git** | Run a git command (output excluded from chat)| | **/help** | Ask questions about aider | | **/lint** | Lint and fix in-chat files or all dirty files if none in chat | | **/ls** | List all known files and indicate which are included in the chat session | From 010f921c53abfca0982a98417c674d9fec873300 Mon Sep 17 00:00:00 2001 From: fry69 <142489379+fry69@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:11:26 +0200 Subject: [PATCH 20/21] doc: fix /paste entry in commands.html spilling into new line --- aider/commands.py | 2 +- aider/website/docs/usage/commands.md | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index 977aeba06..052ec8bc8 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1040,7 +1040,7 @@ class Commands: return text def cmd_paste(self, args): - """Paste image/text from the clipboard into the chat. + """Paste image/text from the clipboard into the chat.\ Optionally provide a name for the image.""" try: # Check for image first diff --git a/aider/website/docs/usage/commands.md b/aider/website/docs/usage/commands.md index 20456ecc7..4700d77f0 100644 --- a/aider/website/docs/usage/commands.md +++ b/aider/website/docs/usage/commands.md @@ -25,7 +25,7 @@ cog.out(get_help_md()) | **/diff** | Display the diff of changes since the last message | | **/drop** | Remove files from the chat session to free up context space | | **/exit** | Exit the application | -| **/git** | Run a git command (output excluded from chat)| +| **/git** | Run a git command (output excluded from chat) | | **/help** | Ask questions about aider | | **/lint** | Lint and fix in-chat files or all dirty files if none in chat | | **/ls** | List all known files and indicate which are included in the chat session | @@ -33,8 +33,7 @@ cog.out(get_help_md()) | **/map-refresh** | Force a refresh of the repository map | | **/model** | Switch to a new LLM | | **/models** | Search the list of available models | -| **/paste** | Paste image/text from the clipboard into the chat. - Optionally provide a name for the image. | +| **/paste** | Paste image/text from the clipboard into the chat. Optionally provide a name for the image. | | **/quit** | Exit the application | | **/read-only** | Add files to the chat that are for reference, not to be edited | | **/report** | Report a problem by opening a GitHub Issue | From 8cb3e523a54bd8105e01cc50738a0b387b0e6c44 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 28 Sep 2024 14:31:49 -0700 Subject: [PATCH 21/21] copy --- aider/website/assets/sample.aider.conf.yml | 8 ++++---- aider/website/assets/sample.env | 8 ++++---- aider/website/docs/config/aider_conf.md | 8 ++++---- aider/website/docs/config/dotenv.md | 8 ++++---- aider/website/docs/config/options.md | 4 ---- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index 0f3d173bf..e4b47404a 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -177,16 +177,16 @@ #assistant-output-color: #0088ff ## Set the color for the completion menu (default: terminal's default text color) -#completion-menu-color: default +#completion-menu-color: xxx ## Set the background color for the completion menu (default: terminal's default background color) -#completion-menu-bg-color: default +#completion-menu-bg-color: xxx ## Set the color for the current item in the completion menu (default: terminal's default background color) -#completion-menu-current-color: default +#completion-menu-current-color: xxx ## Set the background color for the current item in the completion menu (default: terminal's default text color) -#completion-menu-current-bg-color: default +#completion-menu-current-bg-color: xxx ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #code-theme: default diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index 12447e181..ba588eb7f 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -181,16 +181,16 @@ #AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff ## Set the color for the completion menu (default: terminal's default text color) -#AIDER_COMPLETION_MENU_COLOR=default +#AIDER_COMPLETION_MENU_COLOR= ## Set the background color for the completion menu (default: terminal's default background color) -#AIDER_COMPLETION_MENU_BG_COLOR=default +#AIDER_COMPLETION_MENU_BG_COLOR= ## Set the color for the current item in the completion menu (default: terminal's default background color) -#AIDER_COMPLETION_MENU_CURRENT_COLOR=default +#AIDER_COMPLETION_MENU_CURRENT_COLOR= ## Set the background color for the current item in the completion menu (default: terminal's default text color) -#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=default +#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR= ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #AIDER_CODE_THEME=default diff --git a/aider/website/docs/config/aider_conf.md b/aider/website/docs/config/aider_conf.md index b11a4249a..bf828ad17 100644 --- a/aider/website/docs/config/aider_conf.md +++ b/aider/website/docs/config/aider_conf.md @@ -225,16 +225,16 @@ cog.outl("```") #assistant-output-color: #0088ff ## Set the color for the completion menu (default: terminal's default text color) -#completion-menu-color: default +#completion-menu-color: xxx ## Set the background color for the completion menu (default: terminal's default background color) -#completion-menu-bg-color: default +#completion-menu-bg-color: xxx ## Set the color for the current item in the completion menu (default: terminal's default background color) -#completion-menu-current-color: default +#completion-menu-current-color: xxx ## Set the background color for the current item in the completion menu (default: terminal's default text color) -#completion-menu-current-bg-color: default +#completion-menu-current-bg-color: xxx ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #code-theme: default diff --git a/aider/website/docs/config/dotenv.md b/aider/website/docs/config/dotenv.md index 6f55ced83..f654c3b77 100644 --- a/aider/website/docs/config/dotenv.md +++ b/aider/website/docs/config/dotenv.md @@ -223,16 +223,16 @@ cog.outl("```") #AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff ## Set the color for the completion menu (default: terminal's default text color) -#AIDER_COMPLETION_MENU_COLOR=default +#AIDER_COMPLETION_MENU_COLOR= ## Set the background color for the completion menu (default: terminal's default background color) -#AIDER_COMPLETION_MENU_BG_COLOR=default +#AIDER_COMPLETION_MENU_BG_COLOR= ## Set the color for the current item in the completion menu (default: terminal's default background color) -#AIDER_COMPLETION_MENU_CURRENT_COLOR=default +#AIDER_COMPLETION_MENU_CURRENT_COLOR= ## Set the background color for the current item in the completion menu (default: terminal's default text color) -#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=default +#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR= ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #AIDER_CODE_THEME=default diff --git a/aider/website/docs/config/options.md b/aider/website/docs/config/options.md index bef493a3d..b22caef25 100644 --- a/aider/website/docs/config/options.md +++ b/aider/website/docs/config/options.md @@ -338,22 +338,18 @@ Environment variable: `AIDER_ASSISTANT_OUTPUT_COLOR` ### `--completion-menu-color COLOR` Set the color for the completion menu (default: terminal's default text color) -Default: default Environment variable: `AIDER_COMPLETION_MENU_COLOR` ### `--completion-menu-bg-color COLOR` Set the background color for the completion menu (default: terminal's default background color) -Default: default Environment variable: `AIDER_COMPLETION_MENU_BG_COLOR` ### `--completion-menu-current-color COLOR` Set the color for the current item in the completion menu (default: terminal's default background color) -Default: default Environment variable: `AIDER_COMPLETION_MENU_CURRENT_COLOR` ### `--completion-menu-current-bg-color COLOR` Set the background color for the current item in the completion menu (default: terminal's default text color) -Default: default Environment variable: `AIDER_COMPLETION_MENU_CURRENT_BG_COLOR` ### `--code-theme VALUE`