diff options
author | kylo252 <59826753+kylo252@users.noreply.github.com> | 2022-12-19 20:42:49 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-12-19 20:42:49 +0000 |
commit | 104b2ff4d0ec9248ba0b979aa3bbccb65fcad422 (patch) | |
tree | 18be50a5c9276638668857594ff9635197541a68 | |
parent | 34820944ed101e1fbad16d552308f1486e715d27 (diff) | |
download | vim-git-104b2ff4d0ec9248ba0b979aa3bbccb65fcad422.tar.gz |
patch 9.0.1082: some jsonc files are not recognizedv9.0.1082
Problem: Some jsonc files are not recognized.
Solution: Add patterns for jsonc and move some from json to jsonc.
(closes #11711)
-rw-r--r-- | runtime/filetype.vim | 17 | ||||
-rw-r--r-- | src/testdir/test_filetype.vim | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 13 insertions, 10 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 588244c8d..cbbe87504 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -993,23 +993,24 @@ au BufNewFile,BufRead *.jgr setf jgraph " Jovial au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial -" JSON -au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json - " JSON5 au BufNewFile,BufRead *.json5 setf json5 " JSON Patch (RFC 6902) -au BufNewFile,BufRead *.json-patch setf json +au BufNewFile,BufRead *.json-patch setf json " Jupyter Notebook is also json -au BufNewFile,BufRead *.ipynb setf json +au BufNewFile,BufRead *.ipynb setf json " Other files that look like json -au BufNewFile,BufRead .babelrc,.eslintrc,.prettierrc,.firebaserc setf json +au BufNewFile,BufRead .prettierrc,.firebaserc setf json -" JSONC -au BufNewFile,BufRead *.jsonc setf jsonc +" JSONC (JSON with comments) +au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc setf jsonc +au BufNewFile,BufRead .jshintc,.hintrc,.swrc,[jt]sconfig*.json setf jsonc + +" JSON +au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json " Jsonnet au BufNewFile,BufRead *.jsonnet,*.libsonnet setf jsonnet diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 1cc3c2965..d3ca2ae4b 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -287,9 +287,9 @@ 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', 'org.eclipse.xyz.prefs'], - \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.babelrc', '.eslintrc', '.prettierrc', '.firebaserc', 'file.slnf'], + \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.prettierrc', '.firebaserc', 'file.slnf'], \ 'json5': ['file.json5'], - \ 'jsonc': ['file.jsonc'], + \ 'jsonc': ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintc', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json'], \ 'jsonnet': ['file.jsonnet', 'file.libsonnet'], \ 'jsp': ['file.jsp'], \ 'julia': ['file.jl'], diff --git a/src/version.c b/src/version.c index 90522fdd2..4baa1b39b 100644 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1082, +/**/ 1081, /**/ 1080, |