From f42309389723932a1b19079dc28f4ecac5e29fdc Mon Sep 17 00:00:00 2001 From: Chris Toomey Date: Sun, 27 Jan 2013 10:58:44 -0500 Subject: [PATCH] Revert "Create runner pane in temp window" This reverts commit 60bb1622d4b061caa1c3349ea5986cd9e1c3f229. --- doc/vim-tmux-runner.txt | 17 ----------------- plugin/vim-tmux-runner.vim | 29 +++++------------------------ 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/doc/vim-tmux-runner.txt b/doc/vim-tmux-runner.txt index f07f20c..0c40de1 100644 --- a/doc/vim-tmux-runner.txt +++ b/doc/vim-tmux-runner.txt @@ -33,7 +33,6 @@ CONTENTS *vtr-contents* 3.9 ................................ |VtrClearOnReattach| 3.10 ............................... |VtrDetachedName| 3.11 ............................... |VtrClearSequence| - 3.12 ............................... |VtrInitTimeout| ============================================================================== ABOUT (1) *VTR-About* @@ -367,21 +366,5 @@ insert mode. See the help file, ':help i_Ctrl-v', for more detail. Default: " " ------------------------------------------------------------------------------- - *VtrInitTimeout* -3.12 g:VtrInitTimeout~ - -Timeout in milliseconds to use when initializing the runner in temporary -window. This is intended to provide the runner sufficient time to run the -initializing commands and then be attached to the Vim window. - -This timeout is only relevant if VTR is configured to cd to the git root, or -run an initial command. These can be set through their respective -configuration options, |g:VtrGitCdUpOnOpen| and |g:VtrInitialCommand|. - - let g:VtrInitTimeout = 100 - -Default: 500 - ============================================================================== vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl: diff --git a/plugin/vim-tmux-runner.vim b/plugin/vim-tmux-runner.vim index c2bb6a7..585a2b2 100644 --- a/plugin/vim-tmux-runner.vim +++ b/plugin/vim-tmux-runner.vim @@ -12,29 +12,16 @@ endfunction function! s:OpenRunnerPane() let s:vim_pane = s:ActiveTmuxPaneNumber() - let remote_cmd = join(["new-window", "-d", "-n", g:VtrDetachedName]) - call s:SendTmuxCommand(remote_cmd) - let [s:detached_window, s:runner_pane] = [s:LastWindowNumber(), 0] + let cmd = join(["split-window -p", s:vtr_percentage, "-".s:vtr_orientation]) + call s:SendTmuxCommand(cmd) + let s:runner_pane = s:ActiveTmuxPaneNumber() + call s:FocusVimPane() if g:VtrGitCdUpOnOpen call s:GitCdUp() endif if g:VtrInitialCommand != "" call s:SendKeys(g:VtrInitialCommand) endif - if g:VtrInitialCommand || g:VtrGitCdUpOnOpen - call s:TimeoutWithProgess() - endif - call s:ReattachPane() -endfunction - -function! s:TimeoutWithProgess() - let timeout_portion = g:VtrInitTimeout / 3 - echohl String | echon 'Preparing runner.' - for time in [1,2,3] - execute join(['sleep', timeout_portion.'m']) - echon '.' - endfor - echohl None endfunction function! s:DetachRunnerPane() @@ -133,12 +120,7 @@ function! s:SendTmuxCommand(command) endfunction function! s:TargetedTmuxCommand(command, target_pane) - if exists("s:detached_window") - let target = ':'.s:detached_window.'.'.a:target_pane - else - let target = a:target_pane - endif - return join([a:command, " -t ", target]) + return a:command . " -t " . a:target_pane endfunction function! s:_SendKeys(keys) @@ -381,7 +363,6 @@ function! s:InitializeVariables() call s:InitVariable("g:VtrClearOnReorient", 1) call s:InitVariable("g:VtrClearOnReattach", 1) call s:InitVariable("g:VtrDetachedName", "VTR_Pane") - call s:InitVariable("g:VtrInitTimeout", 450) call s:InitVariable("g:VtrClearSequence", " ") let s:vtr_percentage = g:VtrPercentage let s:vtr_orientation = g:VtrOrientation