diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim index b47e4f7..669a6e3 100644 --- a/plugin/fireplace.vim +++ b/plugin/fireplace.vim @@ -1436,10 +1436,9 @@ function! fireplace#capture_test_run(expr) abort call add(qflist, entry) endfor call setqflist(qflist) - cwindow endfunction -function! s:RunTests(bang, echo, ...) abort +function! s:RunTests(bang, ...) abort if &autowrite || &autowriteall silent! wall endif @@ -1454,17 +1453,25 @@ function! s:RunTests(bang, echo, ...) abort let expr = join(['(clojure.test/run-tests'] + reqs, ' ').')' endif call fireplace#capture_test_run(pre.expr) - cwindow - if a:echo - echo expr + let was_qf = &buftype ==# 'quickfix' + botright cwindow + if &buftype ==# 'quickfix' && !was_qf + wincmd p endif + for winnr in range(1, winnr('$')) + if getwinvar(winnr, '&buftype') ==# 'quickfix' + call setwinvar(winnr, 'quickfix_title', expr) + return + endif + endfor + echo expr endfunction augroup fireplace_command autocmd! autocmd FileType clojure command! -buffer -bar -bang -nargs=* \ -complete=customlist,fireplace#ns_complete RunTests - \ call s:RunTests(0, 1, ) + \ call s:RunTests(0, ) augroup END " }}}1