]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(json5): Add TODO support to syntax script (#13743)
authorDanek Duvall <duvall@comfychair.org>
Thu, 21 Dec 2023 15:44:19 +0000 (07:44 -0800)
committerGitHub <noreply@github.com>
Thu, 21 Dec 2023 15:44:19 +0000 (16:44 +0100)
Signed-off-by: Danek Duvall <duvall@comfychair.org>
Signed-off-by: Mazunki Hoksaas <rolferen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/json5.vim

index 5b01d33aad7830405ec3084d8ad1a927531c060d..dc0d11b2a1e3f047b22c0ea6c057ca0680296902 100644 (file)
@@ -49,9 +49,11 @@ syn match   json5Key /@\?\%(\I\|\$\)\%(\i\|\$\)*\s*\ze::\@!/ contains=@Spell
 syn match   json5Key /"\([^"]\|\\"\)\{-}"\ze\s*:/ contains=json5Escape,@Spell
 
 " Comment
-syn region  json5LineComment    start=+\/\/+ end=+$+ keepend contains=@Spell
-syn region  json5LineComment    start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend fold contains=@Spell
-syn region  json5Comment        start="/\*"  end="\*/" fold contains=@Spell
+syn region  json5LineComment    start=+\/\/+ end=+$+ keepend contains=@Spell,json5Todo
+syn region  json5LineComment    start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend fold contains=@Spell,json5Todo
+syn region  json5Comment        start="/\*"  end="\*/" fold contains=@Spell,json5Todo
+
+syn keyword json5Todo           contained TODO FIXME XXX
 
 " Define the default highlighting
 hi def link json5String             String
@@ -66,6 +68,7 @@ hi def link json5Boolean            Boolean
 hi def link json5LineComment        Comment
 hi def link json5Comment            Comment
 hi def link json5NumError           Error
+hi def link json5Todo               Todo
 
 if !exists('b:current_syntax')
   let b:current_syntax = 'json5'