Fix finding index to be based on runner type

fix-tmux-next-3dot4
Ryan Glover 11 years ago
parent aa8a444609
commit 7212ae4ee8

@ -54,14 +54,19 @@ function! VimuxSendKeys(keys)
endfunction
function! VimuxOpenRunner()
let height = _VimuxOption("g:VimuxHeight", 20)
let orientation = _VimuxOption("g:VimuxOrientation", "v")
let nearestIndex = _VimuxNearestIndex()
if _VimuxOption("g:VimuxUseNearest", 1) == 1 && nearestIndex != -1
let g:VimuxRunnerIndex = nearestIndex
else
call system("tmux split-window -p ".height." -".orientation)
if _VimuxRunnerType() == "pane"
let height = _VimuxOption("g:VimuxHeight", 20)
let orientation = _VimuxOption("g:VimuxOrientation", "v")
call system("tmux split-window -p ".height." -".orientation)
elseif _VimuxRunnerType() == "window"
call system("tmux new-window")
endif
let g:VimuxRunnerIndex = _VimuxTmuxIndex()
call system("tmux last-"._VimuxRunnerType())
endif
@ -111,7 +116,15 @@ function! _VimuxTmuxSession()
endfunction
function! _VimuxTmuxIndex()
return _VimuxTmuxProperty("P")
if _VimuxRunnerType == "pane"
return _VimuxTmuxPaneIndex()
else
return _VimuxTmuxWindowIndex()
end
endfunction
function! _VimuxTmuxPaneIndex()
return _VimuxTmuxProperty("P")
endfunction
function! _VimuxTmuxWindowIndex()

Loading…
Cancel
Save