From 3c775fd5de5e70d1bf043853615c969332e5e3e5 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 24 Feb 2025 12:09:26 -0800 Subject: [PATCH] fix: Resolve Windows path handling and editor command test issues --- aider/editor.py | 6 +++--- tests/basic/test_editor.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aider/editor.py b/aider/editor.py index c38e24f9d..a7cf74134 100644 --- a/aider/editor.py +++ b/aider/editor.py @@ -88,13 +88,13 @@ def get_environment_editor(default=None): def discover_editor(editor_override=None): """ - Discovers and returns the appropriate editor command as a list of arguments. + Discovers and returns the appropriate editor command. Handles cases where the editor command includes arguments, including quoted arguments with spaces (e.g. 'vim -c "set noswapfile"'). - :return: A list of command parts ready for subprocess execution - :rtype: list[str] + :return: The editor command as a string + :rtype: str """ system = platform.system() if system == "Windows": diff --git a/tests/basic/test_editor.py b/tests/basic/test_editor.py index 41b29e8f1..b187d7d4b 100644 --- a/tests/basic/test_editor.py +++ b/tests/basic/test_editor.py @@ -109,7 +109,7 @@ with open("{log_path}", "w") as f: called_args = f.read().strip() # Verify the editor was called with a .md file - assert called_args.endswith(".md"), called_args + assert called_args.endswith(".md"), f"Called args: {called_args!r}" finally: # Clean up