Use the unified PATH search function

This commit is contained in:
pagedown
2021-12-09 11:32:30 +08:00
parent 3d59e4eac1
commit 02a7316342
4 changed files with 8 additions and 16 deletions
+1 -1
View File
@@ -543,7 +543,7 @@ def get_editor_from_env_vars(opts: Optional[Options] = None) -> List[str]:
editor = get_editor_from_env(shell_env)
for ans in (editor, 'vim', 'nvim', 'vi', 'emacs', 'kak', 'micro', 'nano', 'vis'):
if ans and shutil.which(shlex.split(ans)[0]):
if ans and which(shlex.split(ans)[0], only_system=True):
break
else:
ans = 'vim'