]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0248: filetype: yarn lock files are not recognized v9.1.0248
authorWu, Zhenyu <wuzhenyu@ustc.edu>
Sun, 31 Mar 2024 17:51:19 +0000 (19:51 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 31 Mar 2024 17:51:19 +0000 (19:51 +0200)
Problem:  filetype: yarn lock files are not recognized
Solution: Detect 'yarn.lock' files as yaml
          (Wu, Zhenyu)

closes: #14369

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index a289c85887c4f316fba1216f4851f0190d6bd55e..ca4678cce5a5ea4e8e55952f1207e45c2d50b2fb 100644 (file)
@@ -2959,6 +2959,9 @@ au filetypedetect BufNewFile,BufRead,StdinReadPost *
        \   setf FALLBACK conf |
        \ endif
 
+" Yarn lock
+au BufNewFile,BufRead yarn.lock                        setf yaml
+
 
 " If the GUI is already running, may still need to install the Syntax menu.
 " Don't do it when the 'M' flag is included in 'guioptions'.
index aba03e4b7f330c70d24f08d9bc1b251df97731e0..a8c7ef4adb8e4cc47f5a57c86f614f5d9f569057 100644 (file)
@@ -820,7 +820,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     xsd: ['file.xsd'],
     xslt: ['file.xsl', 'file.xslt'],
     yacc: ['file.yy', 'file.yxx', 'file.y++'],
-    yaml: ['file.yaml', 'file.yml', 'file.eyaml', 'any/.bundle/config', '.clangd', '.clang-format', '.clang-tidy', 'file.mplstyle'],
+    yaml: ['file.yaml', 'file.yml', 'file.eyaml', 'any/.bundle/config', '.clangd', '.clang-format', '.clang-tidy', 'file.mplstyle', 'yarn.lock'],
     yang: ['file.yang'],
     yuck: ['file.yuck'],
     z8a: ['file.z8a'],
index 47d8e14970e97d2fdc5d8e6c869f62ee57b3c5c3..7eb84b74305a0d0a77deb89fa194370fb3f9c8c6 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    248,
 /**/
     247,
 /**/