Skip to content

Commit 515584f

Browse files
committed
Remove s:setRunnerName()
1 parent 2020316 commit 515584f

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

plugin/vimux.vim

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ function! VimuxOpenRunner() abort
111111
call VimuxTmux('new-window '.extraArguments)
112112
endif
113113
let g:VimuxRunnerIndex = s:tmuxProperty('#{pane_id}')
114-
call s:setRunnerName()
114+
let targetName = VimuxOption('VimuxRunnerName')
115+
if targetName !=# ''
116+
call VimuxTmux('select-pane -T '.targetName)
117+
endif
115118
call VimuxTmux('last-'.VimuxOption('VimuxRunnerType'))
116119
endif
117120
endfunction
@@ -283,7 +286,7 @@ function! s:nearestRunnerId() abort
283286
let views = split(
284287
\ VimuxTmux(
285288
\ 'list-'.runnerType.'s'
286-
\ ." -F '#{".runnerType.'_active}:#{'.runnerType."_id}'"
289+
\ ." -F '#{".runnerType.'_active}:#{pane_id}"'
287290
\ .filter),
288291
\ '\n')
289292
" '1:' is the current active pane (the one with vim).
@@ -309,21 +312,6 @@ function! s:getTargetFilter() abort
309312
endif
310313
endfunction
311314

312-
function! s:setRunnerName() abort
313-
" To be called only while the runner is active, including its window and
314-
" session
315-
let targetName = VimuxOption('VimuxRunnerName')
316-
if targetName ==# ''
317-
return
318-
endif
319-
let runnerType = VimuxOption('VimuxRunnerType')
320-
if runnerType ==# 'window'
321-
call VimuxTmux('rename-window '.targetName)
322-
elseif runnerType ==# 'pane'
323-
call VimuxTmux('select-pane -T '.targetName)
324-
endif
325-
endfunction
326-
327315
function! s:tmuxProperty(property) abort
328316
return substitute(VimuxTmux("display -p '".a:property."'"), '\n$', '', '')
329317
endfunction

0 commit comments

Comments
 (0)