# HG changeset patch # User Bram Moolenaar # Date 1583530204 -3600 # Node ID d24e6844aabd4fb0a2505451e705197124b96c45 # Parent 53ee30ecdacf4df13b24fb9b9ce121e755686746 patch 8.2.0360: yaml files are only recognized by the file extension Commit: https://github.com/vim/vim/commit/8eab73132838e977092d7b46f70b4ecf6274fd6a Author: Bram Moolenaar Date: Fri Mar 6 22:25:56 2020 +0100 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) diff --git a/runtime/scripts.vim b/runtime/scripts.vim --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -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 diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -601,6 +601,7 @@ let s:script_checks = { \ 'haskell': [['#!/path/haskell']], \ 'cpp': [['// Standard iostream objects -*- C++ -*-'], \ ['// -*- C++ -*-']], + \ 'yaml': [['%YAML 1.2']], \ } func Test_script_detection() diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 360, +/**/ 359, /**/ 358,