Avoid reading shell env twice to get editor

Its cached, but still...
This commit is contained in:
Kovid Goyal
2025-10-07 22:27:57 +05:30
parent a9f80fe05b
commit 726c693edf

View File

@@ -541,7 +541,8 @@ def get_editor_from_env(env: Mapping[str, str]) -> str | None:
def get_editor_from_env_vars(opts: Options | None = None) -> list[str]:
editor = get_editor_from_env(os.environ)
from .child import default_env
editor = get_editor_from_env(default_env())
if not editor:
shell_env = read_shell_environment(opts)
editor = get_editor_from_env(shell_env)