diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-08-23 18:43:10 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-08-23 18:43:10 +0200 |
commit | 00b8ae0d3d90f80fc817857dca26359b175b18ed (patch) | |
tree | e9b2a6512e6bd7d2d990dababf659e6b3323bc47 /src/ex_docmd.c | |
parent | dde0efed85c0f78048409ef6deada0c6e8d0be3c (diff) | |
download | vim-git-00b8ae0d3d90f80fc817857dca26359b175b18ed.tar.gz |
updated for version 7.3.637v7.3.637
Problem: Cannot catch the error caused by a foldopen when there is no fold.
(ZyX, Issue 48)
Solution: Do not break out of the loop early when inside try/catch.
(Christian Brabandt) Except when there is a syntax error.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index ead520a22..2257c551c 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1295,7 +1295,14 @@ do_cmdline(cmdline, fgetline, cookie, flags) && cstack.cs_trylevel == 0 #endif ) - && !(did_emsg && used_getline + && !(did_emsg +#ifdef FEAT_EVAL + /* Keep going when inside try/catch, so that the error can be + * dealth with, except when it is a syntax error, it may cause + * the :endtry to be missed. */ + && (cstack.cs_trylevel == 0 || did_emsg_syntax) +#endif + && used_getline && (getline_equal(fgetline, cookie, getexmodeline) || getline_equal(fgetline, cookie, getexline))) && (next_cmdline != NULL @@ -1305,6 +1312,7 @@ do_cmdline(cmdline, fgetline, cookie, flags) || (flags & DOCMD_REPEAT))); vim_free(cmdline_copy); + did_emsg_syntax = FALSE; #ifdef FEAT_EVAL free_cmdlines(&lines_ga); ga_clear(&lines_ga); @@ -2137,6 +2145,7 @@ do_one_cmd(cmdlinep, sourcing, if (!sourcing) append_command(*cmdlinep); errormsg = IObuff; + did_emsg_syntax = TRUE; } goto doend; } |