Renamed CloseVimTmuxWindows to CloseVimTmuxPanes and check to make sure other windows exist before running. Fixes #2

1.0.0rc1 0.1.0
benmills 12 years ago
parent d9cd985cdd
commit 4867db4429

@ -48,12 +48,12 @@ Move into the tmux runner pane created by `RunVimTmuxCommand` and enter copy mod
map <Leader>ri :InspectVimTmuxRunner<CR> map <Leader>ri :InspectVimTmuxRunner<CR>
``` ```
### CloseVimTmuxWindows ### CloseVimTmuxPanes
Close all other tmux panes in the current window. Close all other tmux panes in the current window.
```viml ```viml
" Close all other tmux panes in current window " Close all other tmux panes in current window
map <Leader>rx :CloseVimTmuxWindows<CR> map <Leader>rx :CloseVimTmuxPanes<CR>
``` ```
### InterruptVimTmuxRunner ### InterruptVimTmuxRunner
@ -80,7 +80,7 @@ map <Leader>rl :RunLastVimTmuxCommand<CR>
map <Leader>ri :InspectVimTmuxRunner<CR> map <Leader>ri :InspectVimTmuxRunner<CR>
" Close all other tmux panes in current window " Close all other tmux panes in current window
map <Leader>rx :CloseVimTmuxWindows<CR> map <Leader>rx :CloseVimTmuxPanes<CR>
" Interrupt any command running in the runner pane " Interrupt any command running in the runner pane
map <Leader>rs :InterruptVimTmuxRunner<CR> map <Leader>rs :InterruptVimTmuxRunner<CR>

@ -3,6 +3,7 @@ if !has("ruby")
end end
command RunLastVimTmuxCommand :call RunLastVimTmuxCommand() command RunLastVimTmuxCommand :call RunLastVimTmuxCommand()
command CloseVimTmuxPanes :call CloseVimTmuxPanes()
command CloseVimTmuxWindows :call CloseVimTmuxWindows() command CloseVimTmuxWindows :call CloseVimTmuxWindows()
command InspectVimTmuxRunner :call InspectVimTmuxRunner() command InspectVimTmuxRunner :call InspectVimTmuxRunner()
command InterruptVimTmuxRunner :call InterruptVimTmuxRunner() command InterruptVimTmuxRunner :call InterruptVimTmuxRunner()
@ -30,6 +31,12 @@ endfunction
function! CloseVimTmuxWindows() function! CloseVimTmuxWindows()
ruby CurrentTmuxSession.new.close_other_panes ruby CurrentTmuxSession.new.close_other_panes
call ClearVimTmuxWindow() call ClearVimTmuxWindow()
echoerr "CloseVimTmuxWindows is deprecated, use CloseVimTmuxPanes"
endfunction
function! CloseVimTmuxPanes()
ruby CurrentTmuxSession.new.close_other_panes
call ClearVimTmuxWindow()
endfunction endfunction
function! InterruptVimTmuxRunner() function! InterruptVimTmuxRunner()
@ -125,7 +132,9 @@ class TmuxSession
end end
def close_other_panes def close_other_panes
run("kill-pane -a") # if run("list-panes").split("\n").length > 1
run("kill-pane -a")
# end
end end
def move_up_pane def move_up_pane

Loading…
Cancel
Save