From b43575545272aeecf4e140b47485f94131430123 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Fri, 7 Jan 2022 05:51:47 +1100 Subject: [PATCH] fix(runtime): check markdownError before syn-clear (#16930) Avoids `E28: No such highlight group name: markdownError` when using a foreign markdown syntax. --- runtime/syntax/checkhealth.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/syntax/checkhealth.vim b/runtime/syntax/checkhealth.vim index dff880a0bc..37f1822740 100644 --- a/runtime/syntax/checkhealth.vim +++ b/runtime/syntax/checkhealth.vim @@ -12,7 +12,9 @@ unlet! b:current_syntax syn case match " We do not care about markdown syntax errors -syn clear markdownError +if hlexists('markdownError') + syn clear markdownError +endif syn keyword healthError ERROR[:] containedin=markdownCodeBlock,mkdListItemLine syn keyword healthWarning WARNING[:] containedin=markdownCodeBlock,mkdListItemLine