mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
fix: Modify discover_editor to dynamically check platform system
This commit is contained in:
parent
53e46a9251
commit
308c49b2d8
1 changed files with 3 additions and 4 deletions
|
@ -16,8 +16,6 @@ import tempfile
|
||||||
|
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
|
|
||||||
SYSTEM = platform.system()
|
|
||||||
|
|
||||||
DEFAULT_EDITOR_NIX = "vi"
|
DEFAULT_EDITOR_NIX = "vi"
|
||||||
DEFAULT_EDITOR_OS_X = "vim"
|
DEFAULT_EDITOR_OS_X = "vim"
|
||||||
DEFAULT_EDITOR_WINDOWS = "notepad"
|
DEFAULT_EDITOR_WINDOWS = "notepad"
|
||||||
|
@ -100,9 +98,10 @@ def discover_editor():
|
||||||
:return: A list of command parts ready for subprocess execution
|
:return: A list of command parts ready for subprocess execution
|
||||||
:rtype: list[str]
|
:rtype: list[str]
|
||||||
"""
|
"""
|
||||||
if SYSTEM == "Windows":
|
system = platform.system()
|
||||||
|
if system == "Windows":
|
||||||
default_editor = DEFAULT_EDITOR_WINDOWS
|
default_editor = DEFAULT_EDITOR_WINDOWS
|
||||||
elif SYSTEM == "Darwin":
|
elif system == "Darwin":
|
||||||
default_editor = DEFAULT_EDITOR_OS_X
|
default_editor = DEFAULT_EDITOR_OS_X
|
||||||
else:
|
else:
|
||||||
default_editor = DEFAULT_EDITOR_NIX
|
default_editor = DEFAULT_EDITOR_NIX
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue