@@ -54,14 +54,19 @@ function! VimuxSendKeys(keys)
54
54
endfunction
55
55
56
56
function ! VimuxOpenRunner ()
57
- let height = _VimuxOption (" g:VimuxHeight" , 20 )
58
- let orientation = _VimuxOption (" g:VimuxOrientation" , " v" )
59
57
let nearestIndex = _VimuxNearestIndex ()
60
58
61
59
if _VimuxOption (" g:VimuxUseNearest" , 1 ) == 1 && nearestIndex != -1
62
60
let g: VimuxRunnerIndex = nearestIndex
63
61
else
64
- call system (" tmux split-window -p " .height." -" .orientation)
62
+ if _VimuxRunnerType () == " pane"
63
+ let height = _VimuxOption (" g:VimuxHeight" , 20 )
64
+ let orientation = _VimuxOption (" g:VimuxOrientation" , " v" )
65
+ call system (" tmux split-window -p " .height." -" .orientation)
66
+ elseif _VimuxRunnerType () == " window"
67
+ call system (" tmux new-window" )
68
+ endif
69
+
65
70
let g: VimuxRunnerIndex = _VimuxTmuxIndex ()
66
71
call system (" tmux last-" ._VimuxRunnerType ())
67
72
endif
@@ -111,7 +116,15 @@ function! _VimuxTmuxSession()
111
116
endfunction
112
117
113
118
function ! _VimuxTmuxIndex ()
114
- return _VimuxTmuxProperty (" P" )
119
+ if _VimuxRunnerType == " pane"
120
+ return _VimuxTmuxPaneIndex ()
121
+ else
122
+ return _VimuxTmuxWindowIndex ()
123
+ end
124
+ endfunction
125
+
126
+ function ! _VimuxTmuxPaneIndex ()
127
+ return _VimuxTmuxProperty (" P" )
115
128
endfunction
116
129
117
130
function ! _VimuxTmuxWindowIndex ()
0 commit comments