Revert "Create runner pane in temp window"
This reverts commit 60bb1622d4b061caa1c3349ea5986cd9e1c3f229.
This commit is contained in:
parent
fc3acbaded
commit
f423093897
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user