Skip to content

Commit

Permalink
feat(output): close window mapping (q)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarriga committed Nov 8, 2020
1 parent e38f0f3 commit fbce78e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/ultest/output.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ augroup UltestOutputClose
autocmd User UltestOutputOpen call ultest#output#close()
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>
augroup END

function! ultest#output#open(output) abort
if empty(a:output) | return | endif
doautocmd User UltestOutputOpen
Expand Down Expand Up @@ -64,6 +70,7 @@ function! s:OpenFloat(path) abort
let user_window = nvim_get_current_win()
let output_window = nvim_open_win(out_buffer, v:true, opts)
call termopen('less -R -Ps '.a:path)
setfiletype UltestOutput
call nvim_set_current_win(user_window)
let output_win_id = nvim_win_get_number(output_window)
call setwinvar(output_win_id, "&winhl", "Normal:Normal")
Expand Down

0 comments on commit fbce78e

Please sign in to comment.