File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,11 @@ endfunction
66
66
67
67
function ! VimuxOpenRunner ()
68
68
let nearestIndex = _VimuxNearestIndex ()
69
+ let lastIndex = _VimuxLastIndex ()
69
70
70
- if _VimuxOption (" g:VimuxUseNearest" , 1 ) == 1 && nearestIndex != -1
71
+ if _VimuxOption (" g:VimuxUseLast" , 1 ) == 1 && lastIndex != -1
72
+ let g: VimuxRunnerIndex = lastIndex
73
+ elseif _VimuxOption (" g:VimuxUseNearest" , 1 ) == 1 && nearestIndex != -1
71
74
let g: VimuxRunnerIndex = nearestIndex
72
75
else
73
76
if _VimuxRunnerType () == " pane"
@@ -182,6 +185,28 @@ function! _VimuxNearestIndex()
182
185
return -1
183
186
endfunction
184
187
188
+ function ! _VimuxLastIndex ()
189
+
190
+ let currentID = _VimuxTmuxPaneIndex ()
191
+
192
+ call _VimuxTmux (" last-pane" )
193
+ let lastID = _VimuxTmuxPaneIndex ()
194
+ call _VimuxTmux (" last-pane" )
195
+
196
+ if currentID != lastID
197
+ if _VimuxRunnerType () == " window"
198
+ return lastID
199
+ elseif _VimuxRunnerType () == " pane"
200
+ if split (currentID, " \\ ." )[0 ] == split (lastID, " \\ ." )[0 ]
201
+ return lastID
202
+ endif
203
+ endif
204
+ endif
205
+
206
+ return -1
207
+
208
+ endfunction
209
+
185
210
function ! _VimuxRunnerType ()
186
211
return _VimuxOption (" g:VimuxRunnerType" , " pane" )
187
212
endfunction
You can’t perform that action at this time.
0 commit comments