patch 8.2.3190: error messages are spread out
Problem: Error messages are spread out.
Solution: Move error messages to errors.h and give them a clear name.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 7e0bd64..513306b 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -466,7 +466,7 @@
{
if (last_search_pat() == NULL)
{
- emsg(_(e_noprevre));
+ emsg(_(e_no_previous_regular_expression));
goto sortend;
}
regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
@@ -935,7 +935,7 @@
{
if (prevcmd == NULL)
{
- emsg(_(e_noprev));
+ emsg(_(e_no_previous_command));
vim_free(newcmd);
return;
}
@@ -2356,7 +2356,7 @@
else
#endif
if (buf->b_p_ro)
- emsg(_(e_readonly));
+ emsg(_(e_readonly_option_is_set_add_bang_to_override));
else
semsg(_("E505: \"%s\" is read-only (add ! to override)"),
buf->b_fname);
@@ -3763,7 +3763,7 @@
{
if (old_sub == NULL) // there is no previous command
{
- emsg(_(e_nopresub));
+ emsg(_(e_no_previous_substitute_regular_expression));
return;
}
sub = old_sub;
@@ -3779,7 +3779,7 @@
{
if (old_sub == NULL) // there is no previous command
{
- emsg(_(e_nopresub));
+ emsg(_(e_no_previous_substitute_regular_expression));
return;
}
pat = NULL; // search_regcomp() will use previous pattern