Skip to content

Commit

Permalink
feat(summary): misc improvements for custom window
Browse files Browse the repository at this point in the history
See #67
  • Loading branch information
rcarriga committed Sep 26, 2021
1 parent 6635a25 commit dfea06d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions autoload/ultest/output.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ augroup END

augroup UltestOutputMappings
autocmd!
autocmd FileType UltestOutput tnoremap <buffer> q <C-\><C-N><C-W><C-K>
autocmd FileType UltestOutput nnoremap <buffer> q <C-W><C-K>
autocmd FileType UltestOutput tnoremap <buffer> q <C-\><C-N><C-W><C-P>
autocmd FileType UltestOutput nnoremap <buffer> q <C-W><C-P>
augroup END

function! ultest#output#open(test) abort
Expand Down
8 changes: 6 additions & 2 deletions autoload/ultest/summary.vim
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ function! ultest#summary#close() abort
endif
endfunction

function! ultest#summary#toggle() abort
function! ultest#summary#toggle(jump) abort
if s:IsOpen()
call ultest#summary#close()
else
call ultest#summary#open()
if a:jump
call ultest#summary#jumpto()
else
call ultest#summary#open()
end
endif
endfunction

Expand Down
9 changes: 5 additions & 4 deletions doc/ultest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,12 @@ COMMANDS *ultest-commands*
:UltestStopNearest *:UltestStopNearest*
Stop any running jobs and results for the nearest position

:UltestSummary *:UltestSummary*
Toggle the summary window between open and closed
:UltestSummary[!] *:UltestSummary*
Toggle the summary window between open and closed If [!] is given, jump to
the window if opened

:UltestSummaryOpen *:UltestSummaryOpen*
Open the summary window
:UltestSummaryOpen[!] *:UltestSummaryOpen*
Open the summary window If [!] is given, jump to the window

:UltestSummaryClose *:UltestSummaryClose*
Close the summary window
Expand Down
10 changes: 6 additions & 4 deletions plugin/ultest.vim
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,14 @@ command! UltestStop call ultest#stop_file()
command! UltestStopNearest call ultest#stop_nearest()

""
" Toggle the summary window between open and closed
command! UltestSummary call ultest#summary#toggle()
" Toggle the summary window between open and closed.
" If [!] is given, jump to the window if opened
command! -bang UltestSummary call ultest#summary#toggle(expand("<bang>") == "!")

""
" Open the summary window
command! UltestSummaryOpen call ultest#summary#open()
" Open the summary window.
" If [!] is given, jump to the window
command! -bang UltestSummaryOpen call ultest#summary#open(expand("<bang>") == "!")

""
" Close the summary window
Expand Down

0 comments on commit dfea06d

Please sign in to comment.