Wrap tmux cmds with target panes

This commit is contained in:
Chris Toomey 2012-11-23 00:50:43 -05:00
parent ca66df9ec7
commit 4b7f1c5a42

View File

@ -24,7 +24,7 @@ function! s:OpenRunnerPane()
endfunction endfunction
function! s:KillRunnerPane() function! s:KillRunnerPane()
call s:CallTmuxCommand("kill-pane -t " . s:cached_runner_pane) call s:CallTargetedTmuxCommand("kill-pane", s:cached_runner_pane)
unlet s:cached_runner_pane unlet s:cached_runner_pane
endfunction endfunction
@ -42,7 +42,7 @@ function! s:TmuxPanes()
endfunction endfunction
function! s:FocusTmuxPane(pane_number) function! s:FocusTmuxPane(pane_number)
call s:CallTmuxCommand("select-pane -t " . a:pane_number) call s:CallTargetedTmuxCommand("select-pane", a:pane_number)
endfunction endfunction
function! s:FocusRunnerPane() function! s:FocusRunnerPane()
@ -54,6 +54,11 @@ function! s:CallTmuxCommand(command)
return system(prexied_command) return system(prexied_command)
endfunction endfunction
function! s:CallTargetedTmuxCommand(command, target_pane)
let targeted_command = a:command . " -t " . a:target_pane
call s:CallTmuxCommand(targeted_command)
endfunction
command! VTROpenRunner :call s:OpenRunnerPane() command! VTROpenRunner :call s:OpenRunnerPane()
command! VTRKillRunner :call s:KillRunnerPane() command! VTRKillRunner :call s:KillRunnerPane()
command! VTRFocusRunnerPane :call s:FocusRunnerPane() command! VTRFocusRunnerPane :call s:FocusRunnerPane()