vim-patch:8.0.1249: no error when WaitFor() gets an invalid wrong expression

Problem:    No error when WaitFor() gets an invalid wrong expression.
Solution:   Do not ignore errors in evaluationg the expression.  Fix places
            where the expression was wrong.
c20e0d5207
This commit is contained in:
Jan Edmund Lazo 2018-11-19 22:31:11 -05:00
parent e71f43f8e7
commit fdc2707b41

View File

@ -145,15 +145,12 @@ func WaitFor(expr, ...)
let slept = 0
endif
for i in range(timeout / 10)
try
if eval(a:expr)
if has('reltime')
return float2nr(reltimefloat(reltime(start)) * 1000)
endif
return slept
if eval(a:expr)
if has('reltime')
return float2nr(reltimefloat(reltime(start)) * 1000)
endif
catch
endtry
return slept
endif
if !has('reltime')
let slept += 10
endif