mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(ui.open): some URLs fail on Windows
Problem:
On Windows, `explorer.exe` fails to open some URLs, for example:
    :lua vim.ui.open('https://devdocs.io/#q=lua%20lua_call')
https://github.com/neovim/neovim/pull/23401#issuecomment-1641015704
Solution:
Use rundll32 instead.
			
			
This commit is contained in:
		 marshmallow
					marshmallow
				
			
				
					committed by
					
						 Justin M. Keyes
						Justin M. Keyes
					
				
			
			
				
	
			
			
			 Justin M. Keyes
						Justin M. Keyes
					
				
			
						parent
						
							ca9f4a7cb1
						
					
				
				
					commit
					519b9929e9
				
			| @@ -136,7 +136,11 @@ function M.open(path) | |||||||
|   if vim.fn.has('mac') == 1 then |   if vim.fn.has('mac') == 1 then | ||||||
|     cmd = { 'open', path } |     cmd = { 'open', path } | ||||||
|   elseif vim.fn.has('win32') == 1 then |   elseif vim.fn.has('win32') == 1 then | ||||||
|     cmd = { 'explorer', path } |     if vim.fn.executable('rundll32') == 1 then | ||||||
|  |       cmd = { 'rundll32', 'url.dll,FileProtocolHandler', path } | ||||||
|  |     else | ||||||
|  |       return nil, 'vim.ui.open: rundll32 not found' | ||||||
|  |     end | ||||||
|   elseif vim.fn.executable('wslview') == 1 then |   elseif vim.fn.executable('wslview') == 1 then | ||||||
|     cmd = { 'wslview', path } |     cmd = { 'wslview', path } | ||||||
|   elseif vim.fn.executable('xdg-open') == 1 then |   elseif vim.fn.executable('xdg-open') == 1 then | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user