mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
fix(ui.open): use "start" instead of deprecated "rundll32" #36731
Problem:
The rundll32 utility is a leftover from Windows 95, and it has
been deprecated since at least Windows Vista.
Solution:
Use the start command through Command Prompt instead.
(cherry picked from commit c87d92c3b4)
This commit is contained in:
committed by
github-actions[bot]
parent
1f93acc293
commit
fcd0517dee
@@ -151,11 +151,7 @@ function M.open(path, opt)
|
|||||||
elseif vim.fn.has('mac') == 1 then
|
elseif vim.fn.has('mac') == 1 then
|
||||||
cmd = { 'open', path }
|
cmd = { 'open', path }
|
||||||
elseif vim.fn.has('win32') == 1 then
|
elseif vim.fn.has('win32') == 1 then
|
||||||
if vim.fn.executable('rundll32') == 1 then
|
cmd = { 'cmd.exe', '/c', 'start', '', path }
|
||||||
cmd = { 'rundll32', 'url.dll,FileProtocolHandler', path }
|
|
||||||
else
|
|
||||||
return nil, 'vim.ui.open: rundll32 not found'
|
|
||||||
end
|
|
||||||
elseif vim.fn.executable('xdg-open') == 1 then
|
elseif vim.fn.executable('xdg-open') == 1 then
|
||||||
cmd = { 'xdg-open', path }
|
cmd = { 'xdg-open', path }
|
||||||
job_opt.stdout = false
|
job_opt.stdout = false
|
||||||
|
|||||||
Reference in New Issue
Block a user