]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0204: filetype: cps files are not recognized v9.2.0204
authorGuillaume Barbier <barbier.guillaume60@gmail.com>
Thu, 19 Mar 2026 20:24:40 +0000 (20:24 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 19 Mar 2026 20:24:40 +0000 (20:24 +0000)
Problem:  filetype: cps files are not recognized
Solution: Detect *.cps files as json filetype (Guillaume Barbier).

Reference:
https://github.com/cps-org/cps
https://cps-org.github.io/cps/

closes: #19758

Signed-off-by: Guillaume Barbier <barbier.guillaume60@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/ft.vim
src/testdir/test_filetype.vim
src/version.c

index a90655febc3630e0ffc466f4c0e68a87f8a88749..dffbf355f2ab997353316f9ff475e20fb65dac79 100644 (file)
@@ -3,7 +3,7 @@ vim9script
 # Vim functions for file type detection
 #
 # Maintainer:          The Vim Project <https://github.com/vim/vim>
-# Last Change:         2026 Mar 13
+# Last Change:         2026 Mar 19
 # Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 # These functions are moved here from runtime/filetype.vim to make startup
@@ -1789,6 +1789,8 @@ const ft_from_ext = {
   "cairo": "cairo",
   # Cap'n Proto
   "capnp": "capnp",
+  # Common Package Specification
+  "cps": "json",
   # C#
   "cs": "cs",
   "csx": "cs",
index 735b5812417f3989c7f32a855bbd92273f8baca8..58e5de13d14ef17d55c0b3440d0eba995a11e160 100644 (file)
@@ -419,7 +419,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     jovial: ['file.jov', 'file.j73', 'file.jovial'],
     jproperties: ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'],
     jq: ['file.jq'],
-    json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings',
+    json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', 'file.cps',
     '.prettierrc', '.firebaserc', '.stylelintrc', '.lintstagedrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace',
     'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock', '.swcrc', 'composer.lock', 'symfony.lock'],
     json5: ['file.json5'],
index a93d224132b769d26e7e507addd3aa67e1af9977..1463ac6a6c71c5f04da2faebaf3d9072968c5713 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    204,
 /**/
     203,
 /**/