From 7da2b2ba12509c02938a1aa6cbcabee7731f3f73 Mon Sep 17 00:00:00 2001 From: sgpinkus Date: Sat, 4 Jun 2022 12:02:14 +1000 Subject: [PATCH] Remove '---' from firstLineMatch There is no need for it. It is actually a hindrance rather than help because it gobbles up a possible way for YAML sub languages (like Ansible playbooks) to override language-yaml grammar choice. For example they `language-ansible` could use `--- # ansible` or similar but this is not possible because language-yaml matches *everything* using the document separator on first line. Also I can think of at least one other file type that starts with "---" by convention (Jekyll .md templates) so starting with '---' is not very YAML specific. --- grammars/yaml.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammars/yaml.cson b/grammars/yaml.cson index 007be91..4fd1731 100644 --- a/grammars/yaml.cson +++ b/grammars/yaml.cson @@ -16,7 +16,7 @@ 'Boxfile' 'ksy' ] -'firstLineMatch': '^(#cloud-config|---)' +'firstLineMatch': '^#cloud-config' 'patterns': [ { 'include': '#erb'