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>
```
### CloseVimTmuxWindows
### CloseVimTmuxPanes
Close all other tmux panes in the current window.
```viml
" Close all other tmux panes in current window
map <Leader>rx :CloseVimTmuxWindows<CR>
map <Leader>rx :CloseVimTmuxPanes<CR>
```
### InterruptVimTmuxRunner
@ -80,7 +80,7 @@ map <Leader>rl :RunLastVimTmuxCommand<CR>
map <Leader>ri :InspectVimTmuxRunner<CR>
" 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
map <Leader>rs :InterruptVimTmuxRunner<CR>

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

Loading…
Cancel
Save