• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision1e6da8364a0239e844a0567cffd2caff84e0ed19 (tree)
Time2021-07-22 05:30:05
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.3197: error messages are spread out

Commit: https://github.com/vim/vim/commit/d8e44476d84b5f0cc8c4de080a47a3a9af547028
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 21 22:20:33 2021 +0200

patch 8.2.3197: error messages are spread out
Problem: Error messages are spread out.
Solution: Move a few more error messages to errors.h.

Change Summary

Incremental Difference

diff -r 6955c601ed4c -r 1e6da8364a02 src/edit.c
--- a/src/edit.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/edit.c Wed Jul 21 22:30:05 2021 +0200
@@ -165,7 +165,7 @@
165165 // Don't allow inserting in the sandbox.
166166 if (sandbox != 0)
167167 {
168- emsg(_(e_sandbox));
168+ emsg(_(e_not_allowed_in_sandbox));
169169 return FALSE;
170170 }
171171 #endif
diff -r 6955c601ed4c -r 1e6da8364a02 src/errors.h
--- a/src/errors.h Wed Jul 21 21:45:05 2021 +0200
+++ b/src/errors.h Wed Jul 21 22:30:05 2021 +0200
@@ -104,10 +104,43 @@
104104 INIT(= N_("E44: Corrupted regexp program"));
105105 EXTERN char e_readonly_option_is_set_add_bang_to_override[]
106106 INIT(= N_("E45: 'readonly' option is set (add ! to override)"));
107+#ifdef FEAT_EVAL
108+EXTERN char e_cannot_change_readonly_variable_str[]
109+ INIT(= N_("E46: Cannot change read-only variable \"%s\""));
110+#endif
111+#ifdef FEAT_QUICKFIX
112+EXTERN char e_error_while_reading_errorfile[]
113+ INIT(= N_("E47: Error while reading errorfile"));
114+#endif
115+#ifdef HAVE_SANDBOX
116+EXTERN char e_not_allowed_in_sandbox[]
117+ INIT(= N_("E48: Not allowed in sandbox"));
118+#endif
119+EXTERN char e_invalid_scroll_size[]
120+ INIT(= N_("E49: Invalid scroll size"));
121+EXTERN char e_too_many_z[]
122+ INIT(= N_("E50: Too many \\z("));
123+EXTERN char e_too_many_str_open[]
124+ INIT(= N_("E51: Too many %s("));
125+EXTERN char e_unmatched_z[]
126+ INIT(= N_("E52: Unmatched \\z("));
127+EXTERN char e_unmatched_str_percent_open[]
128+ INIT(= N_("E53: Unmatched %s%%("));
129+EXTERN char e_unmatched_str_open[]
130+ INIT(= N_("E54: Unmatched %s("));
131+EXTERN char e_unmatched_str_close[]
132+ INIT(= N_("E55: Unmatched %s)"));
133+EXTERN char e_invalid_character_after_str_at[]
134+ INIT(= N_("E59: invalid character after %s@"));
135+EXTERN char e_too_many_complex_str_curly[]
136+ INIT(= N_("E60: Too many complex %s{...}s"));
137+
138+#ifdef FEAT_EVAL
107139 EXTERN char e_undefined_variable_str[]
108140 INIT(= N_("E121: Undefined variable: %s"));
109141 EXTERN char e_undefined_variable_char_str[]
110142 INIT(= N_("E121: Undefined variable: %c:%s"));
143+#endif
111144 #ifndef FEAT_DIGRAPHS
112145 EXTERN char e_no_digraphs_version[]
113146 INIT(= N_("E196: No digraphs in this version"));
diff -r 6955c601ed4c -r 1e6da8364a02 src/evalvars.c
--- a/src/evalvars.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/evalvars.c Wed Jul 21 22:30:05 2021 +0200
@@ -2232,7 +2232,7 @@
22322232 // VV_RO is also checked when compiling, but let's check here as well.
22332233 if (vimvars[idx].vv_flags & VV_RO)
22342234 {
2235- semsg(_(e_readonlyvar), vimvars[idx].vv_name);
2235+ semsg(_(e_cannot_change_readonly_variable_str), vimvars[idx].vv_name);
22362236 return FAIL;
22372237 }
22382238 if (sandbox && (vimvars[idx].vv_flags & VV_RO_SBX))
@@ -3499,7 +3499,8 @@
34993499 {
35003500 if (flags & DI_FLAGS_RO)
35013501 {
3502- semsg(_(e_readonlyvar), use_gettext ? (char_u *)_(name) : name);
3502+ semsg(_(e_cannot_change_readonly_variable_str),
3503+ use_gettext ? (char_u *)_(name) : name);
35033504 return TRUE;
35043505 }
35053506 if ((flags & DI_FLAGS_RO_SBX) && sandbox)
diff -r 6955c601ed4c -r 1e6da8364a02 src/ex_cmds.c
--- a/src/ex_cmds.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/ex_cmds.c Wed Jul 21 22:30:05 2021 +0200
@@ -3596,7 +3596,7 @@
35963596 */
35973597 if (sandbox != 0)
35983598 {
3599- emsg(_(e_sandbox));
3599+ emsg(_(e_not_allowed_in_sandbox));
36003600 return TRUE;
36013601 }
36023602 #endif
diff -r 6955c601ed4c -r 1e6da8364a02 src/ex_docmd.c
--- a/src/ex_docmd.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/ex_docmd.c Wed Jul 21 22:30:05 2021 +0200
@@ -2112,7 +2112,7 @@
21122112 if (sandbox != 0 && !(ea.argt & EX_SBOXOK))
21132113 {
21142114 // Command not allowed in sandbox.
2115- errormsg = _(e_sandbox);
2115+ errormsg = _(e_not_allowed_in_sandbox);
21162116 goto doend;
21172117 }
21182118 #endif
diff -r 6955c601ed4c -r 1e6da8364a02 src/globals.h
--- a/src/globals.h Wed Jul 21 21:45:05 2021 +0200
+++ b/src/globals.h Wed Jul 21 22:30:05 2021 +0200
@@ -1666,7 +1666,6 @@
16661666 EXTERN char e_letwrong[] INIT(= N_("E734: Wrong variable type for %s="));
16671667 EXTERN char e_illvar[] INIT(= N_("E461: Illegal variable name: %s"));
16681668 EXTERN char e_cannot_mod[] INIT(= N_("E995: Cannot modify existing variable"));
1669-EXTERN char e_readonlyvar[] INIT(= N_("E46: Cannot change read-only variable \"%s\""));
16701669 EXTERN char e_readonlysbx[] INIT(= N_("E794: Cannot set variable in the sandbox: \"%s\""));
16711670 EXTERN char e_stringreq[] INIT(= N_("E928: String required"));
16721671 EXTERN char e_numberreq[] INIT(= N_("E889: Number required"));
@@ -1692,12 +1691,6 @@
16921691 EXTERN char e_reduceempty[] INIT(= N_("E998: Reduce of an empty %s with no initial value"));
16931692 EXTERN char e_no_dict_key[] INIT(= N_("E857: Dictionary key \"%s\" required"));
16941693 #endif
1695-#ifdef FEAT_QUICKFIX
1696-EXTERN char e_readerrf[] INIT(= N_("E47: Error while reading errorfile"));
1697-#endif
1698-#ifdef HAVE_SANDBOX
1699-EXTERN char e_sandbox[] INIT(= N_("E48: Not allowed in sandbox"));
1700-#endif
17011694 EXTERN char e_secure[] INIT(= N_("E523: Not allowed here"));
17021695 EXTERN char e_textlock[] INIT(= N_("E578: Not allowed to change text here"));
17031696 EXTERN char e_textwinlock[] INIT(= N_("E565: Not allowed to change text or change window"));
@@ -1705,7 +1698,6 @@
17051698 || defined(UNIX) || defined(VMS)
17061699 EXTERN char e_screenmode[] INIT(= N_("E359: Screen mode setting not supported"));
17071700 #endif
1708-EXTERN char e_scroll[] INIT(= N_("E49: Invalid scroll size"));
17091701 EXTERN char e_shellempty[] INIT(= N_("E91: 'shell' option is empty"));
17101702 #if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK)
17111703 EXTERN char e_signdata[] INIT(= N_("E255: Couldn't read in sign data!"));
diff -r 6955c601ed4c -r 1e6da8364a02 src/option.c
--- a/src/option.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/option.c Wed Jul 21 22:30:05 2021 +0200
@@ -1485,7 +1485,7 @@
14851485 // Disallow changing some options in the sandbox
14861486 if (sandbox != 0 && (flags & P_SECURE))
14871487 {
1488- errmsg = e_sandbox;
1488+ errmsg = e_not_allowed_in_sandbox;
14891489 goto skip;
14901490 }
14911491 #endif
@@ -3757,7 +3757,7 @@
37573757 if (pp == &(curwin->w_p_scr))
37583758 {
37593759 if (curwin->w_p_scr != 0)
3760- errmsg = e_scroll;
3760+ errmsg = e_invalid_scroll_size;
37613761 win_comp_scroll(curwin);
37623762 }
37633763 // If 'scroll' became invalid because of a side effect silently adjust
@@ -3793,7 +3793,7 @@
37933793 p_sj = Rows / 2;
37943794 else
37953795 {
3796- errmsg = e_scroll;
3796+ errmsg = e_invalid_scroll_size;
37973797 p_sj = 1;
37983798 }
37993799 }
@@ -4366,7 +4366,7 @@
43664366 // Disallow changing some options in the sandbox
43674367 if (sandbox > 0 && (flags & P_SECURE))
43684368 {
4369- emsg(_(e_sandbox));
4369+ emsg(_(e_not_allowed_in_sandbox));
43704370 return NULL;
43714371 }
43724372 #endif
diff -r 6955c601ed4c -r 1e6da8364a02 src/quickfix.c
--- a/src/quickfix.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/quickfix.c Wed Jul 21 22:30:05 2021 +0200
@@ -1769,7 +1769,7 @@
17691769 retval = qfl->qf_count;
17701770 goto qf_init_end;
17711771 }
1772- emsg(_(e_readerrf));
1772+ emsg(_(e_error_while_reading_errorfile));
17731773 error2:
17741774 if (!adding)
17751775 {
diff -r 6955c601ed4c -r 1e6da8364a02 src/regexp.c
--- a/src/regexp.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/regexp.c Wed Jul 21 22:30:05 2021 +0200
@@ -74,9 +74,6 @@
7474 static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
7575 static char_u e_reverse_range[] = N_("E944: Reverse range in character class");
7676 static char_u e_large_class[] = N_("E945: Range too large in character class");
77-static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
78-static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
79-static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)");
8077 #ifdef FEAT_SYN_HL
8178 static char_u e_z_not_allowed[] = N_("E66: \\z( not allowed here");
8279 static char_u e_z1_not_allowed[] = N_("E67: \\z1 - \\z9 not allowed here");
diff -r 6955c601ed4c -r 1e6da8364a02 src/regexp_bt.c
--- a/src/regexp_bt.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/regexp_bt.c Wed Jul 21 22:30:05 2021 +0200
@@ -2158,7 +2158,7 @@
21582158 }
21592159 }
21602160 if (lop == END)
2161- EMSG2_RET_NULL(_("E59: invalid character after %s@"),
2161+ EMSG2_RET_NULL(_(e_invalid_character_after_str_at),
21622162 reg_magic == MAGIC_ALL);
21632163 // Look behind must match with behind_pos.
21642164 if (lop == BEHIND || lop == NOBEHIND)
@@ -2199,7 +2199,7 @@
21992199 else
22002200 {
22012201 if (num_complex_braces >= 10)
2202- EMSG2_RET_NULL(_("E60: Too many complex %s{...}s"),
2202+ EMSG2_RET_NULL(_(e_too_many_complex_str_curly),
22032203 reg_magic == MAGIC_ALL);
22042204 reginsert(BRACE_COMPLEX + num_complex_braces, ret);
22052205 regoptail(ret, regnode(BACK));
@@ -2369,7 +2369,7 @@
23692369 {
23702370 // Make a ZOPEN node.
23712371 if (regnzpar >= NSUBEXP)
2372- EMSG_RET_NULL(_("E50: Too many \\z("));
2372+ EMSG_RET_NULL(_(e_too_many_z));
23732373 parno = regnzpar;
23742374 regnzpar++;
23752375 ret = regnode(ZOPEN + parno);
@@ -2380,7 +2380,7 @@
23802380 {
23812381 // Make a MOPEN node.
23822382 if (regnpar >= NSUBEXP)
2383- EMSG2_RET_NULL(_("E51: Too many %s("), reg_magic == MAGIC_ALL);
2383+ EMSG2_RET_NULL(_(e_too_many_str_open), reg_magic == MAGIC_ALL);
23842384 parno = regnpar;
23852385 ++regnpar;
23862386 ret = regnode(MOPEN + parno);
@@ -2437,18 +2437,18 @@
24372437 {
24382438 #ifdef FEAT_SYN_HL
24392439 if (paren == REG_ZPAREN)
2440- EMSG_RET_NULL(_("E52: Unmatched \\z("));
2440+ EMSG_RET_NULL(_(e_unmatched_z));
24412441 else
24422442 #endif
24432443 if (paren == REG_NPAREN)
2444- EMSG2_RET_NULL(_(e_unmatchedpp), reg_magic == MAGIC_ALL);
2444+ EMSG2_RET_NULL(_(e_unmatched_str_percent_open), reg_magic == MAGIC_ALL);
24452445 else
2446- EMSG2_RET_NULL(_(e_unmatchedp), reg_magic == MAGIC_ALL);
2446+ EMSG2_RET_NULL(_(e_unmatched_str_open), reg_magic == MAGIC_ALL);
24472447 }
24482448 else if (paren == REG_NOPAREN && peekchr() != NUL)
24492449 {
24502450 if (curchr == Magic(')'))
2451- EMSG2_RET_NULL(_(e_unmatchedpar), reg_magic == MAGIC_ALL);
2451+ EMSG2_RET_NULL(_(e_unmatched_str_close), reg_magic == MAGIC_ALL);
24522452 else
24532453 EMSG_RET_NULL(_(e_trailing)); // "Can't happen".
24542454 // NOTREACHED
diff -r 6955c601ed4c -r 1e6da8364a02 src/regexp_nfa.c
--- a/src/regexp_nfa.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/regexp_nfa.c Wed Jul 21 22:30:05 2021 +0200
@@ -2561,14 +2561,15 @@
25612561 if (paren != REG_NOPAREN && getchr() != Magic(')'))
25622562 {
25632563 if (paren == REG_NPAREN)
2564- EMSG2_RET_FAIL(_(e_unmatchedpp), reg_magic == MAGIC_ALL);
2564+ EMSG2_RET_FAIL(_(e_unmatched_str_percent_open),
2565+ reg_magic == MAGIC_ALL);
25652566 else
2566- EMSG2_RET_FAIL(_(e_unmatchedp), reg_magic == MAGIC_ALL);
2567+ EMSG2_RET_FAIL(_(e_unmatched_str_open), reg_magic == MAGIC_ALL);
25672568 }
25682569 else if (paren == REG_NOPAREN && peekchr() != NUL)
25692570 {
25702571 if (peekchr() == Magic(')'))
2571- EMSG2_RET_FAIL(_(e_unmatchedpar), reg_magic == MAGIC_ALL);
2572+ EMSG2_RET_FAIL(_(e_unmatched_str_close), reg_magic == MAGIC_ALL);
25722573 else
25732574 EMSG_RET_FAIL(_("E873: (NFA regexp) proper termination error"));
25742575 }
diff -r 6955c601ed4c -r 1e6da8364a02 src/undo.c
--- a/src/undo.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/undo.c Wed Jul 21 22:30:05 2021 +0200
@@ -324,7 +324,7 @@
324324 // In the sandbox it's not allowed to change the text.
325325 if (sandbox != 0)
326326 {
327- emsg(_(e_sandbox));
327+ emsg(_(e_not_allowed_in_sandbox));
328328 return FALSE;
329329 }
330330 #endif
diff -r 6955c601ed4c -r 1e6da8364a02 src/version.c
--- a/src/version.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/version.c Wed Jul 21 22:30:05 2021 +0200
@@ -756,6 +756,8 @@
756756 static int included_patches[] =
757757 { /* Add new patch number below this line */
758758 /**/
759+ 3197,
760+/**/
759761 3196,
760762 /**/
761763 3195,
diff -r 6955c601ed4c -r 1e6da8364a02 src/vim9compile.c
--- a/src/vim9compile.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/vim9compile.c Wed Jul 21 22:30:05 2021 +0200
@@ -2477,7 +2477,7 @@
24772477 || (check_writable == ASSIGN_FINAL
24782478 && sv->sv_const == ASSIGN_CONST))
24792479 {
2480- semsg(_(e_readonlyvar), name);
2480+ semsg(_(e_cannot_change_readonly_variable_str), name);
24812481 return FAIL;
24822482 }
24832483 return OK;
diff -r 6955c601ed4c -r 1e6da8364a02 src/vim9script.c
--- a/src/vim9script.c Wed Jul 21 21:45:05 2021 +0200
+++ b/src/vim9script.c Wed Jul 21 22:30:05 2021 +0200
@@ -962,7 +962,7 @@
962962 {
963963 if (sv->sv_const != 0)
964964 {
965- semsg(_(e_readonlyvar), name);
965+ semsg(_(e_cannot_change_readonly_variable_str), name);
966966 return FAIL;
967967 }
968968 ret = check_typval_type(sv->sv_type, value, where);
Show on old repository browser