summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2005-01-06 23:19:09 +0000
committervimboss <devnull@localhost>2005-01-06 23:19:09 +0000
commit6ef38409d52dbd710a6afab5b9c0b24c1401d5cf (patch)
tree12ab76d44cf158f46662abe0d713f92b9846fb1b
parent992b4e4229aee860b8e06c912e890da944e6d9b0 (diff)
downloadvim-6ef38409d52dbd710a6afab5b9c0b24c1401d5cf.tar.gz
updated for version 7.0032
-rw-r--r--src/ex_docmd.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1173e92c..fcc24d26 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1114,9 +1114,9 @@ do_cmdline(cmdline, getline, cookie, flags)
else
{
/* can only get here with ":endwhile" or ":endfor" */
- --cstack.cs_looplevel;
if (cstack.cs_idx >= 0)
- --cstack.cs_idx;
+ rewind_conditionals(&cstack, cstack.cs_idx - 1,
+ CSF_WHILE | CSF_FOR, &cstack.cs_looplevel);
}
}
@@ -1239,11 +1239,18 @@ do_cmdline(cmdline, getline, cookie, flags)
* ":endtry" in a sourced file or executed function. If the try
* conditional is in its finally clause, ignore anything pending.
* If it is in a catch clause, finish the caught exception.
+ * Also cleanup any "cs_forinfo" structures.
*/
do
- cstack.cs_idx = cleanup_conditionals(&cstack, 0, TRUE);
- while (--cstack.cs_idx >= 0)
- ;
+ {
+ int idx = cleanup_conditionals(&cstack, 0, TRUE);
+
+ if (idx == cstack.cs_idx)
+ --idx; /* remove at least one */
+ rewind_conditionals(&cstack, idx, CSF_WHILE | CSF_FOR,
+ &cstack.cs_looplevel);
+ }
+ while (cstack.cs_idx >= 0);
trylevel = initial_trylevel;
}