Skip to content

Commit

Permalink
refactor: Simplify file display logic and label formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Nov 13, 2024
1 parent 6fc3776 commit 33555ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aider/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,14 @@ def format_files_for_input(self, rel_fnames, rel_read_only_fnames):
editable_files = [f for f in sorted(rel_fnames) if f not in rel_read_only_fnames]

if read_only_files:
files_with_label = ["Read only:"] + read_only_files
files_with_label = ["Readonly:"] + read_only_files
read_only_output = StringIO()
Console(file=read_only_output, force_terminal=False).print(Columns(files_with_label))
read_only_lines = read_only_output.getvalue().splitlines()
console.print(Columns(files_with_label))

if editable_files:
files_with_label = editable_files
if read_only_files:
files_with_label = ["Editable:"] + editable_files
editable_output = StringIO()
Expand All @@ -747,7 +748,6 @@ def format_files_for_input(self, rel_fnames, rel_read_only_fnames):

if len(read_only_lines) > 1 or len(editable_lines) > 1:
console.print()
files_with_label = ["Editable:"] + editable_files
console.print(Columns(files_with_label))

return output.getvalue()
Expand Down

0 comments on commit 33555ca

Please sign in to comment.