runtime(autoload/dist): gx may use xdg-open on macOS
Commit:
https://github.com/vim/vim/commit/c9e4b1e770f91cf5718f3d3fb9ed6e62e2b800ee
Author: Lifepillar <
lifep...@lifepillar.me>
Date: Wed Jul 1 18:24:44 2026 +0000
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 <
lifep...@lifepillar.me>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim
index a8bb4f95d..cb90a955e 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 <
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))
@@ -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