To: vim_dev@googlegroups.com Subject: Patch 8.2.3081 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3081 Problem: Cannot catch errors in a channel command. Solution: Instead of skipping the error make it silent. (closes #8477) Files: src/channel.c *** ../vim-8.2.3080/src/channel.c 2021-06-27 22:03:28.637707737 +0200 --- src/channel.c 2021-06-30 21:58:59.852656536 +0200 *************** *** 2545,2551 **** char_u *json = NULL; // Don't pollute the display with errors. ! ++emsg_skip; if (!is_call) { ch_log(channel, "Evaluating expression '%s'", (char *)arg); --- 2545,2552 ---- char_u *json = NULL; // Don't pollute the display with errors. ! // Do generate the errors so that try/catch works. ! ++emsg_silent; if (!is_call) { ch_log(channel, "Evaluating expression '%s'", (char *)arg); *************** *** 2581,2587 **** vim_free(json); } } ! --emsg_skip; if (tv == &res_tv) clear_tv(tv); else --- 2582,2588 ---- vim_free(json); } } ! --emsg_silent; if (tv == &res_tv) clear_tv(tv); else *** ../vim-8.2.3080/src/version.c 2021-06-30 21:30:07.496195277 +0200 --- src/version.c 2021-06-30 21:59:28.384600580 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3081, /**/ -- Q: Should I clean my house or work on Vim? A: Whatever contains more bugs. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///