diff options
author | Yi Ming <ofseed@foxmail.com> | 2024-09-08 05:14:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-07 14:14:37 -0700 |
commit | d338ec9cb299ca300e732da643616121361006cf (patch) | |
tree | 8ef4085c88db43e1a12b2b2b13a5f85cc93f251f /runtime/lua/vim/ui.lua | |
parent | 5ddf2ab7684b799073f2b9c0240692f250bc7c02 (diff) | |
download | rneovim-d338ec9cb299ca300e732da643616121361006cf.tar.gz rneovim-d338ec9cb299ca300e732da643616121361006cf.tar.bz2 rneovim-d338ec9cb299ca300e732da643616121361006cf.zip |
fix(vim.ui.open): prefer xdg-open on WSL #30302
xdg-open is usually not installed in WSL. But if the user deliberately
installs it, presumably they want to prioritize it.
Diffstat (limited to 'runtime/lua/vim/ui.lua')
-rw-r--r-- | runtime/lua/vim/ui.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua index 2d3b828ea1..3617e1d702 100644 --- a/runtime/lua/vim/ui.lua +++ b/runtime/lua/vim/ui.lua @@ -152,14 +152,14 @@ function M.open(path) else return nil, 'vim.ui.open: rundll32 not found' end - elseif vim.fn.executable('wslview') == 1 then - cmd = { 'wslview', path } - elseif vim.fn.executable('explorer.exe') == 1 then - cmd = { 'explorer.exe', path } elseif vim.fn.executable('xdg-open') == 1 then cmd = { 'xdg-open', path } opts.stdout = false opts.stderr = false + elseif vim.fn.executable('wslview') == 1 then + cmd = { 'wslview', path } + elseif vim.fn.executable('explorer.exe') == 1 then + cmd = { 'explorer.exe', path } else return nil, 'vim.ui.open: no handler found (tried: wslview, explorer.exe, xdg-open)' end |