Problem: gx mapping: when macOS have xdg-open in PATH, that takes
precedence over open.
Solution: check for 'osx' feature instead of executables, and do it
before checking for executables.
closes: #20687
Signed-off-by: Lifepillar <lifepillar@lifepillar.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
# Vim runtime support library
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
-# Last Change: 2026 May 30
+# Last Change: 2026 Jul 01
export def IsSafeExecutable(filetype: string, executable: string): bool
if empty(exepath(executable))
# Windows
elseif has('win32')
os_viewer = '' # Use :!start
+# MacOS
+elseif has('osx')
+ os_viewer = 'open'
# WSL
elseif executable('explorer.exe')
os_viewer = 'explorer.exe'
# Linux / BSD
elseif executable('xdg-open')
os_viewer = 'xdg-open'
-# MacOS
-elseif executable('open')
- os_viewer = 'open'
endif
def Viewer(): string