summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-06 22:25:56 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-06 22:25:56 +0100
commit8eab73132838e977092d7b46f70b4ecf6274fd6a (patch)
tree4e43087b980b1397dc397675c00055d7f1901a8c
parentba2920fe976b37326933afa820616523b509495f (diff)
patch 8.2.0360: yaml files are only recognized by the file extensionv8.2.0360
Problem: Yaml files are only recognized by the file extension. Solution: Check for a line starting with "%YAML". (Jason Franklin)
-rw-r--r--runtime/scripts.vim4
-rw-r--r--src/testdir/test_filetype.vim1
-rw-r--r--src/version.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index a690431014..c552f0202f 100644
--- 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
index 7ea1a7427a..4531b2ade6 100644
--- 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
index e6c6bc94de..608532006d 100644
--- 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,