mirror of
https://github.com/neovim/neovim.git
synced 2025-11-07 11:14:26 +00:00
fix(lsp/window_showDocument): correctly handle external resources #20867
- since cmd is a list, it runs directly ('no shell') and we shouldn't
escape.
- typo: shellerror -> shell_error
This commit is contained in:
@@ -519,15 +519,15 @@ M['window/showDocument'] = function(_, result, ctx, _)
|
|||||||
-- TODO(lvimuser): ask the user for confirmation
|
-- TODO(lvimuser): ask the user for confirmation
|
||||||
local cmd
|
local cmd
|
||||||
if vim.fn.has('win32') == 1 then
|
if vim.fn.has('win32') == 1 then
|
||||||
cmd = { 'cmd.exe', '/c', 'start', '""', vim.fn.shellescape(uri) }
|
cmd = { 'cmd.exe', '/c', 'start', '""', uri }
|
||||||
elseif vim.fn.has('macunix') == 1 then
|
elseif vim.fn.has('macunix') == 1 then
|
||||||
cmd = { 'open', vim.fn.shellescape(uri) }
|
cmd = { 'open', uri }
|
||||||
else
|
else
|
||||||
cmd = { 'xdg-open', vim.fn.shellescape(uri) }
|
cmd = { 'xdg-open', uri }
|
||||||
end
|
end
|
||||||
|
|
||||||
local ret = vim.fn.system(cmd)
|
local ret = vim.fn.system(cmd)
|
||||||
if vim.v.shellerror ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
return {
|
return {
|
||||||
success = false,
|
success = false,
|
||||||
error = {
|
error = {
|
||||||
|
|||||||
Reference in New Issue
Block a user