From 716bebad486a4364ae5383f7c25aa9919f15143a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 6 Mar 2020 19:04:42 -0500 Subject: [PATCH] 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) https://github.com/vim/vim/commit/8eab73132838e977092d7b46f70b4ecf6274fd6a --- runtime/scripts.vim | 4 ++++ src/nvim/testdir/test_filetype.vim | 1 + 2 files changed, 5 insertions(+) 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/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 7290cceb0b..9605348389 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -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()