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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user