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