Skip to content

Commit

Permalink
fix(eslint): update openDoc os call for windows
Browse files Browse the repository at this point in the history
Problem:
os.execute misinterprets quoted url as window title

Solution:
replace it with vim.ui.open()
  • Loading branch information
Kushal-Chandar committed Feb 14, 2025
1 parent 6c17f86 commit ffc08b9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lua/lspconfig/configs/eslint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,8 @@ return {
end,
handlers = {
['eslint/openDoc'] = function(_, result)
if not result then
return
end
local sysname = vim.loop.os_uname().sysname
if sysname:match 'Windows' then
os.execute(string.format('start %q', result.url))
elseif sysname:match 'Linux' then
os.execute(string.format('xdg-open %q', result.url))
else
os.execute(string.format('open %q', result.url))
if result then
vim.ui.open(result.url)
end
return {}
end,
Expand Down

0 comments on commit ffc08b9

Please sign in to comment.