aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2016-12-09 19:54:24 +0100
committerGitHub <noreply@github.com>2016-12-09 19:54:24 +0100
commit5082af415f762e5f5974214e32deff883141bfc2 (patch)
treeaaa6568a79e2d920b53bf3de827adde8959572de
parent7da7ff7c5c79dd36e053f5b5e86046838445bb8e (diff)
downloadrneovim-5082af415f762e5f5974214e32deff883141bfc2.tar.gz
rneovim-5082af415f762e5f5974214e32deff883141bfc2.tar.bz2
rneovim-5082af415f762e5f5974214e32deff883141bfc2.zip
Health: rework syntax (#5744)
- By re-enabling code blocks (every line that doesn't begin with a "-" and is indented by at least 4 spaces), we prevent the Markdown syntax to evaluate "_" as beginning for italic text. That's the case for `:CheckHealth deoplete` for instance. It would output: $ cat /tmp/log_{PID} Since the deoplete check gets run first, almost all of the following `:CheckHealth` output would be italic. - Since we re-enable code blocks, we now have to tell our custom syntax that it can be part of markdownCodeBlock as well. Otherwise there would be no highlithing for our keywords ERROR, INFO, etc. after 4 spaces of indent. - Since we do the above anyway, we make it work for mkdListItemLine as well. That's a highlight group from `plasticboy/vim-markdown` opposed to the shipped markdown syntax (which essentially is `tpope/vim-markdown`). Before this patch there was no highlighting at all in the `:CheckHealth` output.
-rw-r--r--runtime/autoload/health.vim11
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim
index 38e3804bf4..a63eebae13 100644
--- a/runtime/autoload/health.vim
+++ b/runtime/autoload/health.vim
@@ -2,29 +2,32 @@ function! s:enhance_syntax() abort
syntax case match
syntax keyword healthError ERROR
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthError Error
syntax keyword healthWarning WARNING
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthWarning WarningMsg
syntax keyword healthInfo INFO
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthInfo ModeMsg
syntax keyword healthSuccess SUCCESS
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthSuccess ModeMsg
syntax keyword healthSuggestion SUGGESTIONS
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthSuggestion String
syntax match healthHelp "|.\{-}|" contains=healthBar
+ \ containedin=markdownCodeBlock,mkdListItemLine
syntax match healthBar "|" contained conceal
highlight link healthHelp Identifier
" We do not care about markdown syntax errors in :CheckHealth output.
highlight! link markdownError Normal
-
- " We don't need code blocks.
- silent! syntax clear markdownCodeBlock
endfunction
" Runs the specified healthchecks.
@@ -68,6 +71,8 @@ function! health#check(plugin_names) abort
endfor
endif
+ " needed for plasticboy/vim-markdown, because it uses fdm=expr
+ normal! zR
setlocal nomodified
redraw|echo ''
endfunction