Skip to content

refactor(utils): replace utils.open() with vim.open() #891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/orgmode/export/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Export._exporter(cmd, target, on_success, on_error)
label = 'Yes',
key = 'y',
action = function()
return utils.open(target)
return vim.ui.open(target)
end,
})
menu:add_option({ label = 'No', key = 'n' })
Expand Down
17 changes: 0 additions & 17 deletions lua/orgmode/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,6 @@ function utils.system_notification(message)
end
end

function utils.open(target)
if vim.fn.executable('xdg-open') == 1 then
vim.system({ 'xdg-open', target }, { text = false })
return 0
end

if vim.fn.executable('open') == 1 then
vim.system({ 'open', target }, { text = false })
return 0
end

if vim.fn.has('win32') == 1 then
vim.system({ 'start', target }, { text = false })
return 0
end
end

---@param msg string|table
---@param additional_msg? table
---@param store_in_history? boolean
Expand Down
Loading