patch 8.2.3970: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
diff --git a/src/option.c b/src/option.c
index caa6abc..96caa70 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1509,7 +1509,7 @@
if (vim_strchr((char_u *)"?!&<", nextchar) != NULL
&& arg[1] != NUL && !VIM_ISWHITE(arg[1]))
{
- errmsg = e_trailing;
+ errmsg = e_trailing_characters;
goto skip;
}
}
@@ -1566,7 +1566,7 @@
}
if (nextchar != '?'
&& nextchar != NUL && !VIM_ISWHITE(afterchar))
- errmsg = e_trailing;
+ errmsg = e_trailing_characters;
}
else
{
@@ -1610,7 +1610,7 @@
*/
if (nextchar != NUL && !VIM_ISWHITE(afterchar))
{
- errmsg = e_trailing;
+ errmsg = e_trailing_characters;
goto skip;
}
if (prefix == 2) // inv
@@ -2710,7 +2710,7 @@
|| sandbox != 0
#endif
) && (options[opt_idx].flags & P_SECURE))
- return e_secure;
+ return e_not_allowed_here;
#if defined(FEAT_EVAL)
// Save the global value before changing anything. This is needed as for
@@ -3304,7 +3304,7 @@
|| sandbox != 0
#endif
) && (options[opt_idx].flags & P_SECURE))
- return e_secure;
+ return e_not_allowed_here;
#if defined(FEAT_EVAL)
// Save the global value before changing anything. This is needed as for
@@ -3350,7 +3350,7 @@
}
if (p_wmh > p_wh)
{
- errmsg = e_winheight;
+ errmsg = e_winheight_cannot_be_smaller_than_winminheight;
p_wh = p_wmh;
}
if (p_hh < 0)
@@ -3378,7 +3378,7 @@
}
if (p_wmh > p_wh)
{
- errmsg = e_winheight;
+ errmsg = e_winheight_cannot_be_smaller_than_winminheight;
p_wmh = p_wh;
}
win_setminheight();
@@ -3393,7 +3393,7 @@
}
if (p_wmw > p_wiw)
{
- errmsg = e_winwidth;
+ errmsg = e_winwidth_cannot_be_smaller_than_winminwidth;
p_wiw = p_wmw;
}
@@ -3411,7 +3411,7 @@
}
if (p_wmw > p_wiw)
{
- errmsg = e_winwidth;
+ errmsg = e_winwidth_cannot_be_smaller_than_winminwidth;
p_wmw = p_wiw;
}
win_setminwidth();