comparison src/testdir/shared.vim @ 10309:88331ee68367 v8.0.0050

commit https://github.com/vim/vim/commit/01688ad545ff0809ddad5c8fa6b149dc5d67312b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 27 20:00:07 2016 +0200 patch 8.0.0050 Problem: An exiting job is detected with a large latency. Solution: Check for pending job more often. (Ozaki Kiichi) Change the double loop in mch_inchar() into one.
author Christian Brabandt <cb@256bit.org>
date Thu, 27 Oct 2016 20:15:04 +0200
parents 7f38e72a9d65
children e664ee056a84
comparison
equal deleted inserted replaced
10308:c6e8a776a1ed 10309:88331ee68367
134 sleep 10m 134 sleep 10m
135 endfor 135 endfor
136 return 1000 136 return 1000
137 endfunc 137 endfunc
138 138
139 " Wait for up to a given milliseconds.
140 " With the +timers feature this waits for key-input by getchar(), Resume()
141 " feeds key-input and resumes process. Return time waited in milliseconds.
142 " Without +timers it uses simply :sleep.
143 func Standby(msec)
144 if has('timers')
145 let start = reltime()
146 let g:_standby_timer = timer_start(a:msec, function('s:feedkeys'))
147 call getchar()
148 return float2nr(reltimefloat(reltime(start)) * 1000)
149 else
150 execute 'sleep ' a:msec . 'm'
151 return a:msec
152 endif
153 endfunc
154
155 func Resume()
156 if exists('g:_standby_timer')
157 call timer_stop(g:_standby_timer)
158 call s:feedkeys(0)
159 unlet g:_standby_timer
160 endif
161 endfunc
162
163 func s:feedkeys(timer)
164 call feedkeys('x', 'nt')
165 endfunc
166
139 " Run Vim, using the "vimcmd" file and "-u NORC". 167 " Run Vim, using the "vimcmd" file and "-u NORC".
140 " "before" is a list of Vim commands to be executed before loading plugins. 168 " "before" is a list of Vim commands to be executed before loading plugins.
141 " "after" is a list of Vim commands to be executed after loading plugins. 169 " "after" is a list of Vim commands to be executed after loading plugins.
142 " Plugins are not loaded, unless 'loadplugins' is set in "before". 170 " Plugins are not loaded, unless 'loadplugins' is set in "before".
143 " Return 1 if Vim could be executed. 171 " Return 1 if Vim could be executed.