diff src/vim9execute.c @ 22760:d235c5fa0bbe v8.2.1928

patch 8.2.1928: Vim9: "silent!" not effective when list index is wrong Commit: https://github.com/vim/vim/commit/cd030c4b604bea92311e9c418aefe5143dee9201 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 30 21:49:40 2020 +0100 patch 8.2.1928: Vim9: "silent!" not effective when list index is wrong Problem: Vim9: "silent!" not effective when list index is wrong. Solution: Ignore list indes failure when emsg_silent is set. (closes https://github.com/vim/vim/issues/7232)
author Bram Moolenaar <Bram@vim.org>
date Fri, 30 Oct 2020 22:00:03 +0100
parents 48feb3dd0d25
children 96dbb61a54c2
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2869,6 +2869,10 @@ func_return:
 	continue;
 
 on_error:
+	// If "emsg_silent" is set then ignore the error.
+	if (did_emsg == did_emsg_before && emsg_silent)
+	    continue;
+
 	// If we are not inside a try-catch started here, abort execution.
 	if (trylevel <= trylevel_at_start)
 	    goto failed;