To: vim-dev@vim.org Subject: Patch 6.2.399 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.399 Problem: A ":set" command that fails still writes a message when it is inside a try/catch block. Solution: Include all the text of the message in the error message. Files: src/charset.c, src/option.c *** ../vim-6.2.398/src/charset.c Sat Sep 27 19:36:46 2003 --- src/charset.c Tue Mar 23 22:12:10 2004 *************** *** 274,281 **** return OK; } - #if defined(FEAT_TITLE) || defined(FEAT_STL_OPT) || defined(FEAT_WINDOWS) \ - || defined(PROTO) /* * Translate any special characters in buf[bufsize] in-place. * The result is a string with only printable characters, but if there is not --- 274,279 ---- *************** *** 317,323 **** buf += trs_len; } } - #endif #if defined(FEAT_EVAL) || defined(FEAT_TITLE) || defined(PROTO) /* --- 315,320 ---- *** ../vim-6.2.398/src/option.c Tue Mar 23 21:23:28 2004 --- src/option.c Tue Mar 23 22:28:04 2004 *************** *** 4025,4045 **** break; } } - arg = skipwhite(arg); if (errmsg != NULL) { ! ++no_wait_return; /* wait_return done below */ ! EMSG(_(errmsg)); /* show error highlighted */ ! MSG_PUTS(": "); ! /* show argument normal */ ! while (startarg < arg) ! startarg = msg_outtrans_one(startarg, 0); ! msg_end(); /* check for scrolling */ --no_wait_return; return FAIL; } } return OK; --- 4037,4066 ---- break; } } if (errmsg != NULL) { ! STRNCPY(IObuff, _(errmsg), IOSIZE - 1); ! IObuff[IOSIZE - 1] = NUL; ! i = STRLEN(IObuff) + 2; ! if (i + (arg - startarg) < IOSIZE) ! { ! /* append the argument with the error */ ! STRCAT(IObuff, ": "); ! mch_memmove(IObuff + i, startarg, (arg - startarg)); ! IObuff[i + (arg - startarg)] = NUL; ! } ! /* make sure all characters are printable */ ! trans_characters(IObuff, IOSIZE); ! ! ++no_wait_return; /* wait_return done later */ ! emsg(IObuff); /* show error highlighted */ --no_wait_return; return FAIL; } + + arg = skipwhite(arg); } return OK; *** ../vim-6.2.398/src/version.c Tue Mar 23 21:23:28 2004 --- src/version.c Tue Mar 23 23:05:54 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 399, /**/ -- hundred-and-one symptoms of being an internet addict: 127. You bring your laptop and cellular phone to church. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///