vim-patch:8.2.0360: yaml files are only recognized by the file extension

Problem:    Yaml files are only recognized by the file extension.
Solution:   Check for a line starting with "%YAML". (Jason Franklin)
8eab731328
This commit is contained in:
Jan Edmund Lazo 2020-03-06 19:04:42 -05:00
parent 63d8f08b0b
commit 716bebad48
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 5 additions and 0 deletions

View File

@ -376,6 +376,10 @@ else
elseif s:line1 =~? '-\*-.*erlang.*-\*-'
set ft=erlang
" YAML
elseif s:line1 =~# '^%YAML'
set ft=yaml
" CVS diff
else
let s:lnum = 1

View File

@ -600,6 +600,7 @@ let s:script_checks = {
\ 'haskell': [['#!/path/haskell']],
\ 'cpp': [['// Standard iostream objects -*- C++ -*-'],
\ ['// -*- C++ -*-']],
\ 'yaml': [['%YAML 1.2']],
\ }
func Test_script_detection()