Skip to content
This repository was archived by the owner on Mar 21, 2022. It is now read-only.

Commit ee0ab83

Browse files
lanzakevinoid
authored andcommitted
Don't error if g:vim_json_warnings is toggled
You can disable vim_json_warnings via this varaible and it'll prevent jsonComentError from being defined and thus this line will cause runtime errors. Guard it here.
1 parent 274d619 commit ee0ab83

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

syntax/jsonc.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ endif
2020
runtime syntax/json.vim
2121

2222
" Remove syntax group for comments treated as errors
23-
syn clear jsonCommentError
23+
if !exists("g:vim_json_warnings") || g:vim_json_warnings
24+
syn clear jsonCommentError
25+
endif
2426

2527
" Define syntax matching comments and their contents
2628
syn keyword jsonCommentTodo FIXME NOTE TBD TODO XXX

0 commit comments

Comments
 (0)