To: vim-dev@vim.org Subject: Patch 6.1.047 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.047 Problem: When skipping commands after an error was encountered, expressions for ":if", ";elseif" and ":while" are still evaluated. Solution: Skip the expression after an error. (Servatius Brandt) Files: src/ex_docmd.c *** ../vim61.046/src/ex_docmd.c Wed May 1 19:40:35 2002 --- src/ex_docmd.c Fri May 3 22:06:38 2002 *************** *** 7197,7202 **** --- 7197,7205 ---- #ifdef FEAT_EVAL + /* + * ":if". + */ static void ex_if(eap) exarg_T *eap; *************** *** 7214,7223 **** cstack->cs_flags[cstack->cs_idx] = 0; /* ! * Don't do something when there is a surrounding conditional and it ! * was not active. */ ! skip = (cstack->cs_idx > 0 && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE)); result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip); --- 7217,7226 ---- cstack->cs_flags[cstack->cs_idx] = 0; /* ! * Don't do something after an error or when there is a surrounding ! * conditional and it was not active. */ ! skip = did_emsg || (cstack->cs_idx > 0 && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE)); result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip); *************** *** 7269,7278 **** else { /* ! * Don't do something when there is a surrounding conditional and it ! * was not active. */ ! skip = (cstack->cs_idx > 0 && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE)); if (!skip) { --- 7272,7281 ---- else { /* ! * Don't do something after an error or when there is a surrounding ! * conditional and it was not active. */ ! skip = did_emsg || (cstack->cs_idx > 0 && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE)); if (!skip) { *************** *** 7332,7341 **** cstack->cs_flags[cstack->cs_idx] = CSF_WHILE; /* ! * Don't do something when there is a surrounding conditional and it ! * was not active. */ ! skip = (cstack->cs_idx > 0 && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE)); result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip); --- 7335,7344 ---- cstack->cs_flags[cstack->cs_idx] = CSF_WHILE; /* ! * Don't do something after an error or when there is a surrounding ! * conditional and it was not active. */ ! skip = did_emsg || (cstack->cs_idx > 0 && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE)); result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip); *** ../vim61.046/src/version.c Fri May 3 22:02:55 2002 --- src/version.c Fri May 3 22:08:52 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 47, /**/ -- Biting someone with your natural teeth is "simple assault," while biting someone with your false teeth is "aggravated assault." [real standing law in Louisana, United States of America] /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///