diff options
-rw-r--r-- | runtime/autoload/health.vim | 18 | ||||
-rw-r--r-- | runtime/autoload/health/provider.vim | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index cbfd7c76a1..346b6e386e 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -9,13 +9,20 @@ function! s:enhance_syntax() abort highlight link healthInfo ModeMsg syntax keyword healthSuccess SUCCESS - highlight link healthSuccess Function + highlight link healthSuccess ModeMsg syntax keyword healthSuggestion SUGGESTIONS highlight link healthSuggestion String + syntax match healthHelp "|.\{-}|" contains=healthBar + 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. + syntax clear markdownCodeBlock endfunction " Runs the specified healthchecks. @@ -28,6 +35,8 @@ function! health#check(plugin_names) abort tabnew setlocal wrap breakindent setlocal filetype=markdown bufhidden=wipe + setlocal conceallevel=2 concealcursor=nc + setlocal keywordprg=:help call s:enhance_syntax() if empty(healthchecks) @@ -78,6 +87,11 @@ function! s:indent_after_line1(s, columns) abort return join(lines, "\n") endfunction +" Changes ':help clipboard' to '|clipoard|'. Also removes surrounding quotes. +function! s:help_to_link(s) abort + return substitute(a:s, '\v[''"]?:h%[elp] ([^''"]+)[''"]?', '|\1|', 'g') +endfunction + " Format a message for a specific report item function! s:format_report_message(status, msg, ...) abort " {{{ let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4) @@ -99,7 +113,7 @@ function! s:format_report_message(status, msg, ...) abort " {{{ let output .= "\n - " . s:indent_after_line1(suggestion, 10) endfor - return output + return s:help_to_link(output) endfunction " }}} " Use {msg} to report information in the current section diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 3c40e48b2e..b3af3d50bc 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -53,7 +53,7 @@ function! s:check_clipboard() abort if empty(clipboard_tool) call health#report_warn( \ "No clipboard tool found. Using the system clipboard won't work.", - \ ['See ":help clipboard"']) + \ ['See |clipboard|.']) else call health#report_ok('Clipboard tool found: '. clipboard_tool) endif |