1
0
forked from aniani/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)
This commit is contained in:
Bram Moolenaar
2020-03-06 22:25:56 +01:00
parent ba2920fe97
commit 8eab731328
3 changed files with 7 additions and 0 deletions

View File

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

View File

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

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
360,
/**/ /**/
359, 359,
/**/ /**/