From 38d923977ccaa64fad17a22c5fc857898b0efcab Mon Sep 17 00:00:00 2001 From: Gabe Dunn Date: Sun, 13 Oct 2019 08:27:58 -0700 Subject: [PATCH] Focus Runner w/o Zooming - Bang Style (#94) Add bang param on VtrFocusRunner to not zoom the focused pane --- doc/vim-tmux-runner.txt | 7 ++++--- plugin/vim-tmux-runner.vim | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/vim-tmux-runner.txt b/doc/vim-tmux-runner.txt index 3a6c468..22642fa 100644 --- a/doc/vim-tmux-runner.txt +++ b/doc/vim-tmux-runner.txt @@ -146,9 +146,10 @@ pane. *VtrFocusRunner* 2.5 VtrFocusRunner~ -Move the cursor to the runner to interact directly with it. A new runner will -be created if one does not exist and a detached pane will be restored as -needed. +Move the cursor to the runner to interact directly with it and zooms the +pane. A new runner will be created if one does not exist and a detached +pane will be restored as needed. To not zoom the runner pane, add a bang: +VtrFocusRunner!. ------------------------------------------------------------------------------ *VtrResizeRunner* diff --git a/plugin/vim-tmux-runner.vim b/plugin/vim-tmux-runner.vim index 4af8fc6..5c90a26 100644 --- a/plugin/vim-tmux-runner.vim +++ b/plugin/vim-tmux-runner.vim @@ -145,10 +145,12 @@ function! s:RunnerPaneDimensions() endfor endfunction -function! s:FocusRunnerPane() +function! s:FocusRunnerPane(should_zoom) if !s:ValidRunnerPaneSet() | return | endif call s:FocusTmuxPane(s:runner_pane) - call s:SendTmuxCommand("resize-pane -Z") + if a:should_zoom + call s:SendTmuxCommand("resize-pane -Z") + endif endfunction function! s:Strip(string) @@ -471,7 +473,7 @@ function! s:DefineCommands() command! -bang VtrSendFile call s:SendFileViaVtr(0) command! -nargs=? VtrOpenRunner call s:EnsureRunnerPane() command! VtrKillRunner call s:KillRunnerPane() - command! VtrFocusRunner call s:FocusRunnerPane() + command! -bang VtrFocusRunner call s:FocusRunnerPane(!0) command! VtrReorientRunner call s:ReorientRunner() command! VtrDetachRunner call s:DetachRunnerPane() command! VtrReattachRunner call s:ReattachPane()