aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-01-23 16:19:48 +0100
committerGitHub <noreply@github.com>2022-01-23 16:19:48 +0100
commitffd9551aa210ecd652044ad3c43eb480858f191a (patch)
tree22a2d3e0a99e926f91a22bdbb6d4f2d536c5c79f
parent3d62dd207733bbdc46fd5b6807e5d7dcf95681e2 (diff)
downloadrneovim-ffd9551aa210ecd652044ad3c43eb480858f191a.tar.gz
rneovim-ffd9551aa210ecd652044ad3c43eb480858f191a.tar.bz2
rneovim-ffd9551aa210ecd652044ad3c43eb480858f191a.zip
vim-patch:8.2.4191: json5 files are not recognized (#17180)
Problem: json5 files are not recognized. Solution: Add a pattern for json5 files. (closes vim/vim#9601) https://github.com/vim/vim/commit/e15ebeffb35da4bb7d9054358671735ce6988c28
-rw-r--r--runtime/filetype.vim3
-rw-r--r--runtime/lua/vim/filetype.lua1
-rw-r--r--src/nvim/testdir/test_filetype.vim1
3 files changed, 5 insertions, 0 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 803de5e0c7..cd80f9786c 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -882,6 +882,9 @@ 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
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index e5168403b2..060022bce1 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -293,6 +293,7 @@ local extension = {
webmanifest = "json",
ipynb = "json",
["json-patch"] = "json",
+ json5 = "json5",
jsonc = "jsonc",
jsp = "jsp",
jl = "julia",
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index e2cf0c3e69..b5fa362e48 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -265,6 +265,7 @@ let s:filename_checks = {
\ '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.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.babelrc', '.eslintrc', '.prettierrc', '.firebaserc', 'file.slnf'],
+ \ 'json5': ['file.json5'],
\ 'jsonc': ['file.jsonc'],
\ 'jsp': ['file.jsp'],
\ 'julia': ['file.jl'],