+54
-36
lines changedFilter options
+54
-36
lines changed Original file line number Diff line number Diff line change
@@ -1,41 +1,13 @@
1
-
function! s:enhance_syntax() abort
2
-
syntax case match
3
-
4
-
syntax keyword healthError ERROR[:]
5
-
\ containedin=markdownCodeBlock,mkdListItemLine
6
-
highlight default link healthError Error
7
-
8
-
syntax keyword healthWarning WARNING[:]
9
-
\ containedin=markdownCodeBlock,mkdListItemLine
10
-
highlight default link healthWarning WarningMsg
11
-
12
-
syntax keyword healthSuccess OK[:]
13
-
\ containedin=markdownCodeBlock,mkdListItemLine
14
-
highlight default healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232
15
-
16
-
syntax match healthHelp "|.\{-}|" contains=healthBar
17
-
\ containedin=markdownCodeBlock,mkdListItemLine
18
-
syntax match healthBar "|" contained conceal
19
-
highlight default link healthHelp Identifier
20
-
21
-
" We do not care about markdown syntax errors in :checkhealth output.
22
-
highlight! link markdownError Normal
23
-
endfunction
24
-
25
1
" Runs the specified healthchecks.
26
2
" Runs all discovered healthchecks if a:plugin_names is empty.
27
3
function! health#check(plugin_names) abort
28
4
let healthchecks = empty(a:plugin_names)
29
5
\ ? s:discover_healthchecks()
30
6
\ : s:get_healthcheck(a:plugin_names)
31
7
32
-
tabnew
33
-
setlocal wrap breakindent linebreak
34
-
setlocal filetype=markdown
35
-
setlocal conceallevel=2 concealcursor=nc
36
-
setlocal keywordprg=:help
37
-
let &l:iskeyword='!-~,^*,^|,^",192-255'
38
-
call s:enhance_syntax()
8
+
" create scratch-buffer
9
+
execute 'tab sbuffer' nvim_create_buf(v:true, v:true)
10
+
setfiletype checkhealth
39
11
40
12
if empty(healthchecks)
41
13
call setline(1, 'ERROR: No healthchecks found.')
@@ -70,8 +42,6 @@ function! health#check(plugin_names) abort
70
42
71
43
" needed for plasticboy/vim-markdown, because it uses fdm=expr
72
44
normal! zR
73
-
setlocal nomodified
74
-
setlocal bufhidden=hide
75
45
redraw|echo ''
76
46
endfunction
77
47
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
1
+
" Vim filetype plugin
2
+
" Language: Neovim checkhealth buffer
3
+
" Last Change: 2021 Dec 15
4
+
5
+
if exists("b:did_ftplugin")
6
+
finish
7
+
endif
8
+
9
+
runtime! ftplugin/markdown.vim ftplugin/markdown_*.vim ftplugin/markdown/*.vim
10
+
11
+
setlocal wrap breakindent linebreak
12
+
setlocal conceallevel=2 concealcursor=nc
13
+
setlocal keywordprg=:help
14
+
let &l:iskeyword='!-~,^*,^|,^",192-255'
15
+
16
+
if exists("b:undo_ftplugin")
17
+
let b:undo_ftplugin .= "|setl wrap< bri< lbr< cole< cocu< kp< isk<"
18
+
else
19
+
let b:undo_ftplugin = "setl wrap< bri< lbr< cole< cocu< kp< isk<"
20
+
endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
1
+
" Vim syntax file
2
+
" Language: Neovim checkhealth buffer
3
+
" Last Change: 2021 Dec 15
4
+
5
+
if exists("b:current_syntax")
6
+
finish
7
+
endif
8
+
9
+
runtime! syntax/markdown.vim
10
+
unlet! b:current_syntax
11
+
12
+
syn case match
13
+
14
+
" We do not care about markdown syntax errors
15
+
syn clear markdownError
16
+
17
+
syn keyword healthError ERROR[:] containedin=markdownCodeBlock,mkdListItemLine
18
+
syn keyword healthWarning WARNING[:] containedin=markdownCodeBlock,mkdListItemLine
19
+
syn keyword healthSuccess OK[:] containedin=markdownCodeBlock,mkdListItemLine
20
+
syn match healthHelp "|.\{-}|" containedin=markdownCodeBlock,mkdListItemLine contains=healthBar
21
+
syn match healthBar "|" contained conceal
22
+
23
+
hi def link healthError Error
24
+
hi def link healthWarning WarningMsg
25
+
hi def healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232
26
+
hi def link healthHelp Identifier
27
+
28
+
let b:current_syntax = "checkhealth"
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@ describe('health.vim', function()
156
156
test_plug.submodule_failed: require("test_plug.submodule_failed.health").check()
157
157
========================================================================
158
158
- ERROR: Failed to run healthcheck for "test_plug.submodule_failed" plugin. Exception:
159
-
function health#check, line 24]])
159
+
function health#check, line 20]])
160
160
eq(expected, received)
161
161
end)
162
162
@@ -167,7 +167,7 @@ describe('health.vim', function()
167
167
broken: health#broken#check
168
168
========================================================================
169
169
- ERROR: Failed to run healthcheck for "broken" plugin. Exception:
170
-
function health#check[24]..health#broken#check, line 1
170
+
function health#check[20]..health#broken#check, line 1
171
171
caused an error
172
172
]])
173
173
end)
@@ -186,7 +186,7 @@ describe('health.vim', function()
186
186
test_plug.submodule_failed: require("test_plug.submodule_failed.health").check()
187
187
========================================================================
188
188
- ERROR: Failed to run healthcheck for "test_plug.submodule_failed" plugin. Exception:
189
-
function health#check, line 24]])
189
+
function health#check, line 20]])
190
190
eq(expected, received)
191
191
end)
192
192
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4