1
0
forked from aniani/vim

patch 7.4.2180

Problem:    There is no easy way to stop all timers.  There is no way to
            temporary pause a timer.
Solution:   Add timer_stopall() and timer_pause().
This commit is contained in:
Bram Moolenaar
2016-08-07 18:22:53 +02:00
parent e4a76ad0e7
commit b73598e2f0
8 changed files with 161 additions and 20 deletions

View File

@@ -109,14 +109,17 @@ func s:kill_server(cmd)
endfunc
" Wait for up to a second for "expr" to become true.
" Return time slept in milliseconds.
func WaitFor(expr)
let slept = 0
for i in range(100)
try
if eval(a:expr)
return
return slept
endif
catch
endtry
let slept += 10
sleep 10m
endfor
endfunc