Skip to content

Commit d7b4b60

Browse files
troigantotroiganto
and
troiganto
authored
refactor(utils): replace utils.open() with vim.open() (#891)
Co-authored-by: troiganto <[email protected]>
1 parent 3583fac commit d7b4b60

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

lua/orgmode/export/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function Export._exporter(cmd, target, on_success, on_error)
4242
label = 'Yes',
4343
key = 'y',
4444
action = function()
45-
return utils.open(target)
45+
return vim.ui.open(target)
4646
end,
4747
})
4848
menu:add_option({ label = 'No', key = 'n' })

lua/orgmode/utils/init.lua

-17
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,6 @@ function utils.system_notification(message)
9494
end
9595
end
9696

97-
function utils.open(target)
98-
if vim.fn.executable('xdg-open') == 1 then
99-
vim.system({ 'xdg-open', target }, { text = false })
100-
return 0
101-
end
102-
103-
if vim.fn.executable('open') == 1 then
104-
vim.system({ 'open', target }, { text = false })
105-
return 0
106-
end
107-
108-
if vim.fn.has('win32') == 1 then
109-
vim.system({ 'start', target }, { text = false })
110-
return 0
111-
end
112-
end
113-
11497
---@param msg string|table
11598
---@param additional_msg? table
11699
---@param store_in_history? boolean

0 commit comments

Comments
 (0)