Set title on test quickfix window
This commit is contained in:
parent
fff348ccd0
commit
6cea463c97
@ -1436,10 +1436,9 @@ function! fireplace#capture_test_run(expr) abort
|
|||||||
call add(qflist, entry)
|
call add(qflist, entry)
|
||||||
endfor
|
endfor
|
||||||
call setqflist(qflist)
|
call setqflist(qflist)
|
||||||
cwindow
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:RunTests(bang, echo, ...) abort
|
function! s:RunTests(bang, ...) abort
|
||||||
if &autowrite || &autowriteall
|
if &autowrite || &autowriteall
|
||||||
silent! wall
|
silent! wall
|
||||||
endif
|
endif
|
||||||
@ -1454,17 +1453,25 @@ function! s:RunTests(bang, echo, ...) abort
|
|||||||
let expr = join(['(clojure.test/run-tests'] + reqs, ' ').')'
|
let expr = join(['(clojure.test/run-tests'] + reqs, ' ').')'
|
||||||
endif
|
endif
|
||||||
call fireplace#capture_test_run(pre.expr)
|
call fireplace#capture_test_run(pre.expr)
|
||||||
cwindow
|
let was_qf = &buftype ==# 'quickfix'
|
||||||
if a:echo
|
botright cwindow
|
||||||
echo expr
|
if &buftype ==# 'quickfix' && !was_qf
|
||||||
|
wincmd p
|
||||||
endif
|
endif
|
||||||
|
for winnr in range(1, winnr('$'))
|
||||||
|
if getwinvar(winnr, '&buftype') ==# 'quickfix'
|
||||||
|
call setwinvar(winnr, 'quickfix_title', expr)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
echo expr
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
augroup fireplace_command
|
augroup fireplace_command
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FileType clojure command! -buffer -bar -bang -nargs=*
|
autocmd FileType clojure command! -buffer -bar -bang -nargs=*
|
||||||
\ -complete=customlist,fireplace#ns_complete RunTests
|
\ -complete=customlist,fireplace#ns_complete RunTests
|
||||||
\ call s:RunTests(<bang>0, 1, <f-args>)
|
\ call s:RunTests(<bang>0, <f-args>)
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
|
Loading…
Reference in New Issue
Block a user