Skip to content

Commit c20e0d5

Browse files
committed
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.
1 parent 5130f31 commit c20e0d5

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/testdir/shared.vim

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,12 @@ func WaitFor(expr, ...)
125125
let slept = 0
126126
endif
127127
for i in range(timeout / 10)
128-
try
129-
if eval(a:expr)
130-
if has('reltime')
131-
return float2nr(reltimefloat(reltime(start)) * 1000)
132-
endif
133-
return slept
128+
if eval(a:expr)
129+
if has('reltime')
130+
return float2nr(reltimefloat(reltime(start)) * 1000)
134131
endif
135-
catch
136-
endtry
132+
return slept
133+
endif
137134
if !has('reltime')
138135
let slept += 10
139136
endif

src/testdir/test_netbeans.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ endfunc
1919

2020
func Nb_basic(port)
2121
call delete("Xnetbeans")
22+
call writefile([], "Xnetbeans")
2223
exe 'nbstart :localhost:' . a:port . ':bunny'
2324
call assert_true(has("netbeans_enabled"))
2425

@@ -53,6 +54,9 @@ func Test_nb_basic()
5354
endfunc
5455

5556
func Nb_file_auth(port)
57+
call delete("Xnetbeans")
58+
call writefile([], "Xnetbeans")
59+
5660
call assert_fails('nbstart =notexist', 'E660:')
5761
call writefile(['host=localhost', 'port=' . a:port, 'auth=bunny'], 'Xnbauth')
5862
if has('unix')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1249,
764766
/**/
765767
1248,
766768
/**/

0 commit comments

Comments
 (0)