From 8a05f05bd4d655dfd6b9782c98212c1f57990aed Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 13 Nov 2024 13:27:06 -0800 Subject: [PATCH] refactor: Improve file list display logic with line-based spacing --- aider/io.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/aider/io.py b/aider/io.py index a6873e35e..328b88bcd 100644 --- a/aider/io.py +++ b/aider/io.py @@ -733,10 +733,20 @@ class InputOutput: if read_only_files: files_with_label = ["Read only:"] + 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: - if read_only_files and (len(read_only_files) > 1 or len(editable_files) > 1): - console.print() + if read_only_files: + files_with_label = ["Editable:"] + editable_files + editable_output = StringIO() + Console(file=editable_output, force_terminal=False).print(Columns(files_with_label)) + editable_lines = editable_output.getvalue().splitlines() + + 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))