Skip to content

Commit 36a82ee

Browse files
committed
Make sure the proper window + pane is selected
1 parent a27583b commit 36a82ee

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

plugin/vimux.vim

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,16 @@ endfunction
140140

141141
function! VimuxZoomRunner() abort
142142
if s:hasRunner()
143-
if VimuxOption('VimuxRunnerType') ==# 'pane'
144-
call VimuxTmux('resize-pane -Z -t '.g:VimuxRunnerIndex)
145-
elseif VimuxOption('VimuxRunnerType') ==# 'window'
146-
call VimuxTmux('select-window -t '.g:VimuxRunnerIndex)
147-
endif
143+
call s:selectRunner()
144+
call VimuxTmux('resize-pane -Z -t '.g:VimuxRunnerIndex)
148145
else
149146
call s:echoNoRunner()
150147
endif
151148
endfunction
152149

153150
function! VimuxInspectRunner() abort
154151
if s:hasRunner()
155-
call VimuxTmux('select-'.VimuxOption('VimuxRunnerType').' -t '.g:VimuxRunnerIndex)
152+
call s:selectRunner()
156153
call VimuxTmux('copy-mode')
157154
return v:true
158155
endif
@@ -228,6 +225,11 @@ function! VimuxTmux(arguments) abort
228225
endif
229226
endfunction
230227

228+
function! s:selectRunner() abort
229+
call VimuxTmux('select-window -t '.g:VimuxRunnerIndex)
230+
call VimuxTmux('select-pane -t '.g:VimuxRunnerIndex)
231+
endfunction
232+
231233
function! s:exitCopyMode() abort
232234
try
233235
call VimuxTmux('copy-mode -q -t '.g:VimuxRunnerIndex)
@@ -308,6 +310,8 @@ function! s:getTargetFilter() abort
308310
endfunction
309311

310312
function! s:setRunnerName() abort
313+
" To be called only while the runner is active, including its window and
314+
" session
311315
let targetName = VimuxOption('VimuxRunnerName')
312316
if targetName ==# ''
313317
return

0 commit comments

Comments
 (0)