To: vim_dev@googlegroups.com Subject: Patch 8.1.05 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0550 Problem: Expression evaluation may repeat an error message. (Jason Franklin) Solution: Increment did_emsg and check for the value when giving an error for the echo command. Files: src/message.c, src/eval.c, src/testdir/test108.ok *** ../vim-8.1.0549/src/message.c 2018-10-07 23:16:33.138616197 +0200 --- src/message.c 2018-11-28 20:30:19.215302673 +0100 *************** *** 636,642 **** if (cause_errthrow(s, severe, &ignore) == TRUE) { if (!ignore) ! did_emsg = TRUE; return TRUE; } --- 636,642 ---- if (cause_errthrow(s, severe, &ignore) == TRUE) { if (!ignore) ! ++did_emsg; return TRUE; } *************** *** 689,695 **** beep_flush(); /* also includes flush_buffers() */ else flush_buffers(FLUSH_MINIMAL); // flush internal buffers ! did_emsg = TRUE; // flag for DoOneCmd() #ifdef FEAT_EVAL did_uncaught_emsg = TRUE; #endif --- 689,695 ---- beep_flush(); /* also includes flush_buffers() */ else flush_buffers(FLUSH_MINIMAL); // flush internal buffers ! ++did_emsg; // flag for DoOneCmd() #ifdef FEAT_EVAL did_uncaught_emsg = TRUE; #endif *** ../vim-8.1.0549/src/eval.c 2018-10-25 13:31:33.829906902 +0200 --- src/eval.c 2018-11-28 20:30:54.619090027 +0100 *************** *** 7999,8004 **** --- 7999,8005 ---- int needclr = TRUE; int atstart = TRUE; char_u numbuf[NUMBUFLEN]; + int did_emsg_before = did_emsg; if (eap->skip) ++emsg_skip; *************** *** 8016,8022 **** * has been cancelled due to an aborting error, an interrupt, or an * exception. */ ! if (!aborting()) EMSG2(_(e_invexpr2), p); need_clr_eos = FALSE; break; --- 8017,8023 ---- * has been cancelled due to an aborting error, an interrupt, or an * exception. */ ! if (!aborting() && did_emsg == did_emsg_before) EMSG2(_(e_invexpr2), p); need_clr_eos = FALSE; break; *** ../vim-8.1.0549/src/testdir/test108.ok 2016-01-16 15:35:46.000000000 +0100 --- src/testdir/test108.ok 2018-11-28 20:37:22.504719732 +0100 *************** *** 28,34 **** Error detected while processing function Foo[2]..Bar[2]..Bazz: line 3: E121: Undefined variable: var3 - E15: Invalid expression: var3 here var3 is defined with "another var": another var --- 28,33 ---- *************** *** 36,42 **** Error detected while processing function Foo[2]..Bar: line 3: E121: Undefined variable: var2 - E15: Invalid expression: var2 here var2 is defined with 10: 10 --- 35,40 ---- *** ../vim-8.1.0549/src/version.c 2018-11-26 21:22:03.128367125 +0100 --- src/version.c 2018-11-28 20:38:15.024394567 +0100 *************** *** 794,795 **** --- 794,797 ---- { /* Add new patch number below this line */ + /**/ + 550, /**/ -- A programmer's wife asks him: "Please run to the store and pick up a loaf of bread. If they have eggs, get a dozen". The programmer comes home with 12 loafs of bread. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///