diff src/ex_cmds.c @ 27962:0fa3be75ddc7 v8.2.4506

patch 8.2.4506: "pattern not found" for :global is not an error message Commit: https://github.com/vim/vim/commit/24d9c0557ef52141d12ac32568967b190d247c6f Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 4 21:34:31 2022 +0000 patch 8.2.4506: "pattern not found" for :global is not an error message Problem: "pattern not found" for :global is not an error message. Solution: In Vim9 script make this an actual error, so that try/catch can be used as expected.
author Bram Moolenaar <Bram@vim.org>
date Fri, 04 Mar 2022 22:45:04 +0100
parents 3ad379c0ab28
children 40e35cefeac6
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5001,9 +5001,19 @@ ex_global(exarg_T *eap)
 	else if (ndone == 0)
 	{
 	    if (type == 'v')
-		smsg(_("Pattern found in every line: %s"), pat);
+	    {
+		if (in_vim9script())
+		    semsg(_(e_pattern_found_in_every_line_str), pat);
+		else
+		    smsg(_("Pattern found in every line: %s"), pat);
+	    }
 	    else
-		smsg(_("Pattern not found: %s"), pat);
+	    {
+		if (in_vim9script())
+		    semsg(_(e_pattern_not_found_str), pat);
+		else
+		    smsg(_("Pattern not found: %s"), pat);
+	    }
 	}
 	else
 	{