mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 05:14:59 +00:00
fix: Resolve Windows path handling and editor command test issues
This commit is contained in:
parent
75e9ee6528
commit
3c775fd5de
2 changed files with 4 additions and 4 deletions
|
@ -88,13 +88,13 @@ def get_environment_editor(default=None):
|
||||||
|
|
||||||
def discover_editor(editor_override=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
|
Handles cases where the editor command includes arguments, including quoted arguments
|
||||||
with spaces (e.g. 'vim -c "set noswapfile"').
|
with spaces (e.g. 'vim -c "set noswapfile"').
|
||||||
|
|
||||||
:return: A list of command parts ready for subprocess execution
|
:return: The editor command as a string
|
||||||
:rtype: list[str]
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
system = platform.system()
|
system = platform.system()
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
|
|
|
@ -109,7 +109,7 @@ with open("{log_path}", "w") as f:
|
||||||
called_args = f.read().strip()
|
called_args = f.read().strip()
|
||||||
|
|
||||||
# Verify the editor was called with a .md file
|
# 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:
|
finally:
|
||||||
# Clean up
|
# Clean up
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue