mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-10 04:23:51 -05:00
Fix ansible ftdetect
This commit is contained in:
14
scripts/test_extensions.vim
Normal file
14
scripts/test_extensions.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
function! TestExtension(filetype, filename, content)
|
||||
try
|
||||
exec "e " . a:filename
|
||||
exec "if &filetype != '" . a:filetype . "' \nthrow &filetype\nendif"
|
||||
catch
|
||||
echo 'Filename "' . a:filename . '" does not resolve to extension "' . a:filetype . '"'
|
||||
echo ' instead received: "' . v:exception . '"'
|
||||
exec ':cq!'
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
call TestExtension('blade', 'test.blade.php', '')
|
||||
call TestExtension('yaml.ansible', 'playbook.yml', '')
|
||||
call TestExtension('yaml.ansible', 'host_vars/foobar', '')
|
||||
Reference in New Issue
Block a user