Skip to content

Commit

Permalink
patch 8.2.0360: yaml files are only recognized by the file extension
Browse files Browse the repository at this point in the history
Problem:    Yaml files are only recognized by the file extension.
Solution:   Check for a line starting with "%YAML". (Jason Franklin)
  • Loading branch information
brammool committed Mar 6, 2020
1 parent ba2920f commit 8eab731
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/scripts.vim
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/testdir/test_filetype.vim
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -738,6 +738,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
360,
/**/
359,
/**/
Expand Down

0 comments on commit 8eab731

Please sign in to comment.