Closed GoogleCodeExporter closed 9 years ago
> try | foldopen | catch | echom v:exception
Of course, here should be trailing `| endtry`.
Original comment by zyx....@gmail.com
on 13 Jan 2012 at 4:20
Bram,
the problem is, the do{} while loop in ex_docmd.c in do_cmdline (line 1289).
If you look at this line:
&& !(did_emsg && used_getline
&& (getline_equal(fgetline, cookie, getexmodeline)
|| getline_equal(fgetline, cookie, getexline)))
Then the loop will always terminate, if did_emsg is set, even so a catch later
on
might actually catch the error. So one probably also needs to check whether a
try-clause if active and if those, let the loop continue.
Something like this patch:
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1295,9 +1295,14 @@
&& cstack.cs_trylevel == 0
#endif
)
- && !(did_emsg && used_getline
+ && !(used_getline
&& (getline_equal(fgetline, cookie, getexmodeline)
- || getline_equal(fgetline, cookie, getexline)))
+ || getline_equal(fgetline, cookie, getexline))
+ && did_emsg
+#ifdef FEAT_EVAL
+ && cstack.cs_trylevel == 0
+#endif
+ )
&& (next_cmdline != NULL
#ifdef FEAT_EVAL
|| cstack.cs_idx >= 0
This almost works, except when using an unknown command like this:
try | foobar|catch|echom v:exception|endtry
then the loop won't terminate.
I am not sure, what the correct abort condition needs to be
in this case.
(and I don't understand all conditions in that loop).
Original comment by chrisbr...@googlemail.com
on 19 Aug 2012 at 12:57
Fixed by 7.3.637
Original comment by chrisbr...@googlemail.com
on 29 Sep 2014 at 4:58
Original issue reported on code.google.com by
zyx....@gmail.com
on 13 Jan 2012 at 4:19