From: Lifepillar Date: Wed, 1 Jul 2026 18:24:44 +0000 (+0000) Subject: runtime(autoload/dist): gx may use xdg-open on macOS X-Git-Tag: v9.2.0759~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9e4b1e770f91cf5718f3d3fb9ed6e62e2b800ee;p=thirdparty%2Fvim.git runtime(autoload/dist): gx may use xdg-open on macOS 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 Signed-off-by: Christian Brabandt --- diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim index a8bb4f95d0..cb90a955e1 100644 --- a/runtime/autoload/dist/vim9.vim +++ b/runtime/autoload/dist/vim9.vim @@ -3,7 +3,7 @@ vim9script # Vim runtime support library # # Maintainer: The Vim Project -# Last Change: 2026 May 30 +# Last Change: 2026 Jul 01 export def IsSafeExecutable(filetype: string, executable: string): bool if empty(exepath(executable)) @@ -89,15 +89,15 @@ if has('win32unix') # 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