mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	test(filetype): symlink detection works after expand('<afile>') (#31307)
Also add a test for #31306, which currently fails.
(cherry picked from commit c697c49a76)
			
			
This commit is contained in:
		
				
					committed by
					
						
						github-actions[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							6f2786433d
						
					
				
				
					commit
					1a12dea191
				
			@@ -190,7 +190,19 @@ describe('filetype.lua', function()
 | 
			
		||||
    finally(function()
 | 
			
		||||
      uv.fs_unlink('Xfiletype/.config/git')
 | 
			
		||||
    end)
 | 
			
		||||
    clear({ args = { '--clean', 'Xfiletype/.config/git/config' } })
 | 
			
		||||
    local args = { '--clean', 'Xfiletype/.config/git/config' }
 | 
			
		||||
    clear({ args = args })
 | 
			
		||||
    eq('gitconfig', api.nvim_get_option_value('filetype', {}))
 | 
			
		||||
    table.insert(args, 2, '--cmd')
 | 
			
		||||
    table.insert(args, 3, "autocmd BufRead * call expand('<afile>')")
 | 
			
		||||
    clear({ args = args })
 | 
			
		||||
    eq('gitconfig', api.nvim_get_option_value('filetype', {}))
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  pending('works with :doautocmd BufRead #31306', function()
 | 
			
		||||
    clear({ args = { '--clean' } })
 | 
			
		||||
    eq('', api.nvim_get_option_value('filetype', {}))
 | 
			
		||||
    command('doautocmd BufRead README.md')
 | 
			
		||||
    eq('markdown', api.nvim_get_option_value('filetype', {}))
 | 
			
		||||
  end)
 | 
			
		||||
end)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user