changeset 25024:a1b0fe1c7cd5 v8.2.3049

patch 8.2.3049: JSON patch file not recognized Commit: https://github.com/vim/vim/commit/6582e230a0f6592287b1123c5fc3807d6fed997e Author: Kevin Locke <kevin@kevinlocke.name> Date: Fri Jun 25 21:54:25 2021 +0200 patch 8.2.3049: JSON patch file not recognized Problem: JSON patch file not recognized. Solution: Recognize json-patch as json. (Kevin Locke, closes https://github.com/vim/vim/issues/8450)
author Bram Moolenaar <Bram@vim.org>
date Fri, 25 Jun 2021 22:00:05 +0200
parents 681a896e37e3
children ebe793e81045
files runtime/filetype.vim src/testdir/test_filetype.vim src/version.c
diffstat 3 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -855,6 +855,9 @@ au BufNewFile,BufRead *.jov,*.j73,*.jovi
 " 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
 
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -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'],
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3049,
+/**/
     3048,
 /**/
     3047,