]> granicus.if.org Git - vim/commitdiff
patch 8.2.3049: JSON patch file not recognized v8.2.3049
authorKevin Locke <kevin@kevinlocke.name>
Fri, 25 Jun 2021 19:54:25 +0000 (21:54 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 25 Jun 2021 19:54:25 +0000 (21:54 +0200)
Problem:    JSON patch file not recognized.
Solution:   Recognize json-patch as json. (Kevin Locke, closes #8450)

runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index 04e20011768764739eaaff194cb4eea0f43838d0..496b58b31352a16c485bae713178ec3e7b21a929 100644 (file)
@@ -855,6 +855,9 @@ au BufNewFile,BufRead *.jov,*.j73,*.jovial  setf jovial
 " JSON
 au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest     setf json
 
+" JSON Patch (RFC 6902)
+au BufNewFile,BufRead *.json-patch                     setf json
+
 " Jupyter Notebook is also json
 au BufNewFile,BufRead *.ipynb                          setf json
 
index 0b670acf74bba1f8ba283daec43bb1d9ce1be4cf..5c9c9753ccc636f65520c31e3de1aab8dfdddd9a 100644 (file)
@@ -257,7 +257,7 @@ let s:filename_checks = {
     \ 'jgraph': ['file.jgr'],
     \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
     \ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file'],
-    \ 'json': ['file.json', 'file.jsonp', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb'],
+    \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb'],
     \ 'jsp': ['file.jsp'],
     \ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'],
     \ 'kivy': ['file.kv'],
index 4cef712b66ed27b1ddc6cfd0df2550114c714a74..36a3970d057de2712521075a422551358c16f8c1 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3049,
 /**/
     3048,
 /**/