aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/ui.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-07-21 06:37:34 -0700
committerGitHub <noreply@github.com>2023-07-21 06:37:34 -0700
commit02d859a07387a952442a72e913b23521ec39c199 (patch)
tree98e6e639f6697fa8b3b3a21652723ec588de941d /runtime/lua/vim/ui.lua
parent4448f594d3d6fbe873fc2b2d832551ef454ed908 (diff)
parent7907b1fca5fce69e966ab1071df8e6d11afda41d (diff)
downloadrneovim-02d859a07387a952442a72e913b23521ec39c199.tar.gz
rneovim-02d859a07387a952442a72e913b23521ec39c199.tar.bz2
rneovim-02d859a07387a952442a72e913b23521ec39c199.zip
Merge #24392 from mrshmllow/gx_win
fix(ui.open): some URLs fail on Windows
Diffstat (limited to 'runtime/lua/vim/ui.lua')
-rw-r--r--runtime/lua/vim/ui.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua
index fd06611da2..87b52787a0 100644
--- a/runtime/lua/vim/ui.lua
+++ b/runtime/lua/vim/ui.lua
@@ -136,7 +136,11 @@ function M.open(path)
if vim.fn.has('mac') == 1 then
cmd = { 'open', path }
elseif vim.fn.has('win32') == 1 then
- cmd = { 'explorer', path }
+ if vim.fn.executable('rundll32') == 1 then
+ cmd = { 'rundll32', 'url.dll,FileProtocolHandler', 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('xdg-open') == 1 then