fix: Resolve Windows path handling and editor command test issues

This commit is contained in:
Paul Gauthier (aider) 2025-02-24 12:09:26 -08:00
parent 75e9ee6528
commit 3c775fd5de
2 changed files with 4 additions and 4 deletions

View file

@ -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":

View file

@ -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