mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	@@ -140,6 +140,9 @@ function M.open(path)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  local cmd --- @type string[]
 | 
			
		||||
  local opts --- @type vim.SystemOpts
 | 
			
		||||
 | 
			
		||||
  opts = { text = true, detach = true }
 | 
			
		||||
 | 
			
		||||
  if vim.fn.has('mac') == 1 then
 | 
			
		||||
    cmd = { 'open', path }
 | 
			
		||||
@@ -155,11 +158,13 @@ function M.open(path)
 | 
			
		||||
    cmd = { 'explorer.exe', path }
 | 
			
		||||
  elseif vim.fn.executable('xdg-open') == 1 then
 | 
			
		||||
    cmd = { 'xdg-open', path }
 | 
			
		||||
    opts.stdout = false
 | 
			
		||||
    opts.stderr = false
 | 
			
		||||
  else
 | 
			
		||||
    return nil, 'vim.ui.open: no handler found (tried: wslview, explorer.exe, xdg-open)'
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  return vim.system(cmd, { text = true, detach = true }), nil
 | 
			
		||||
  return vim.system(cmd, opts), nil
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- Gets the URL at cursor, if any.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user