Skip to content

Commit 373dbf9

Browse files
committed
Add option for when to display build output
1 parent d846e83 commit 373dbf9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

autoload/OmniSharp/testrunner.vim

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ endfunction
6868

6969
function! s:Paint() abort
7070
let lines = []
71+
let delimiter = get(g:, 'OmniSharp_testrunner_banner_delimeter', '')
7172
if get(g:, 'OmniSharp_testrunner_banner', 1)
72-
let delimiter = get(g:, 'OmniSharp_testrunner_banner_delimeter', '')
7373
call add(lines, repeat(delimiter, 80))
7474
call add(lines, ' OmniSharp Test Runner')
7575
call add(lines, ' ' . repeat(delimiter, 76))
@@ -89,15 +89,18 @@ function! s:Paint() abort
8989
for errorline in errors
9090
call add(lines, '< ' . trim(errorline, ' ', 2))
9191
endfor
92-
" The diagnostic logs (build output) are only displayed when a single file
93-
" is tested, otherwise multiple build outputs are intermingled
94-
if OmniSharp#GetHost(s:current.singlebuffer).sln_or_dir ==# sln_or_dir
95-
if len(errors) > 0 && len(s:current.log) > 1
96-
call add(lines, '< ' . repeat(delimiter, 10))
92+
let loglevel = get(g:, 'OmniSharp_testrunner_loglevel', 'error')
93+
if loglevel ==? 'all' || (loglevel ==? 'error' && len(errors))
94+
" The diagnostic logs (build output) are only displayed when a single file
95+
" is tested, otherwise multiple build outputs are intermingled
96+
if OmniSharp#GetHost(s:current.singlebuffer).sln_or_dir ==# sln_or_dir
97+
if len(errors) > 0 && len(s:current.log) > 1
98+
call add(lines, '< ' . repeat(delimiter, 10))
99+
endif
100+
for log in s:current.log
101+
call add(lines, '< ' . trim(log, ' ', 2))
102+
endfor
97103
endif
98-
for log in s:current.log
99-
call add(lines, '< ' . trim(log, ' ', 2))
100-
endfor
101104
endif
102105
for testfile in sort(keys(job.tests[testproject]))
103106
call add(lines, ' ' . fnamemodify(testfile, ':.'))

0 commit comments

Comments
 (0)