]> granicus.if.org Git - vim/commitdiff
patch 8.2.3955: error messages are spread out v8.2.3955
authorBram Moolenaar <Bram@vim.org>
Fri, 31 Dec 2021 15:09:27 +0000 (15:09 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 31 Dec 2021 15:09:27 +0000 (15:09 +0000)
Problem:    Error messages are spread out.
Solution:   Move more errors to errors.h.

src/debugger.c
src/errors.h
src/ex_cmds.c
src/globals.h
src/help.c
src/sign.c
src/spellfile.c
src/version.c

index e21dd22e67985b855294fa7a0420ca23162d2246..57a94a180ab3f857f0c8f411ae25d21347d15add 100644 (file)
@@ -815,7 +815,7 @@ ex_breakdel(exarg_T *eap)
     }
 
     if (todel < 0)
-       semsg(_("E161: Breakpoint not found: %s"), eap->arg);
+       semsg(_(e_breakpoint_not_found_str), eap->arg);
     else
     {
        while (gap->ga_len > 0)
index 692574b1d0ca43b8fe12553bd1f1b18b96394040..592de4598c98049900ebefbff5275ca2c5c37966 100644 (file)
@@ -302,6 +302,54 @@ EXTERN char e_viminfo_file_is_not_writable_str[]
 EXTERN char e_cant_write_viminfo_file_str[]
        INIT(= N_("E138: Can't write viminfo file %s!"));
 #endif
+EXTERN char e_file_is_loaded_in_another_buffer[]
+       INIT(= N_("E139: File is loaded in another buffer"));
+EXTERN char e_use_bang_to_write_partial_buffer[]
+       INIT(= N_("E140: Use ! to write partial buffer"));
+EXTERN char e_no_file_name_for_buffer_nr[]
+       INIT(= N_("E141: No file name for buffer %ld"));
+EXTERN char e_file_not_written_writing_is_disabled_by_write_option[]
+       INIT(= N_("E142: File not written: Writing is disabled by 'write' option"));
+EXTERN char e_autocommands_unexpectedly_deleted_new_buffer_str[]
+       INIT(= N_("E143: Autocommands unexpectedly deleted new buffer %s"));
+EXTERN char e_non_numeric_argument_to_z[]
+       INIT(= N_("E144: non-numeric argument to :z"));
+EXTERN char e_shell_commands_and_some_functionality_not_allowed_in_rvim[]
+       INIT(= N_("E145: Shell commands and some functionality not allowed in rvim"));
+EXTERN char e_regular_expressions_cant_be_delimited_by_letters[]
+       INIT(= N_("E146: Regular expressions can't be delimited by letters"));
+EXTERN char e_cannot_do_global_recursive_with_range[]
+       INIT(= N_("E147: Cannot do :global recursive with a range"));
+EXTERN char e_regular_expression_missing_from_global[]
+       INIT(= N_("E148: Regular expression missing from :global"));
+EXTERN char e_sorry_no_help_for_str[]
+       INIT(= N_("E149: Sorry, no help for %s"));
+EXTERN char e_not_a_directory_str[]
+       INIT(= N_("E150: Not a directory: %s"));
+EXTERN char e_no_match_str[]
+       INIT(= N_("E151: No match: %s"));
+EXTERN char e_cannot_open_str_for_writing[]
+       INIT(= N_("E152: Cannot open %s for writing"));
+EXTERN char e_unable_to_open_str_for_reading[]
+       INIT(= N_("E153: Unable to open %s for reading"));
+EXTERN char e_duplicate_tag_str_in_file_str_str[]
+       INIT(= N_("E154: Duplicate tag \"%s\" in file %s/%s"));
+EXTERN char e_unknown_sign_str[]
+       INIT(= N_("E155: Unknown sign: %s"));
+EXTERN char e_missing_sign_name[]
+       INIT(= N_("E156: Missing sign name"));
+EXTERN char e_invalid_sign_id_nr[]
+       INIT(= N_("E157: Invalid sign ID: %d"));
+EXTERN char e_invalid_buffer_name_str[]
+       INIT(= N_("E158: Invalid buffer name: %s"));
+EXTERN char e_missing_sign_number[]
+       INIT(= N_("E159: Missing sign number"));
+EXTERN char e_unknown_sign_command_str[]
+       INIT(= N_("E160: Unknown sign command: %s"));
+#ifdef FEAT_EVAL
+EXTERN char e_breakpoint_not_found_str[]
+       INIT(= N_("E161: Breakpoint not found: %s"));
+#endif
 
 EXTERN char e_no_such_user_defined_command_str[]
        INIT(= N_("E184: No such user-defined command: %s"));
index c57f3325543005bc61b7012a4e372564df635b3e..8f7418b7f8b14279fecc97cdb1b41fb28f113ab5 100644 (file)
@@ -1941,7 +1941,7 @@ do_write(exarg_T *eap)
        {
            // Overwriting a file that is loaded in another buffer is not a
            // good idea.
-           emsg(_(e_bufloaded));
+           emsg(_(e_file_is_loaded_in_another_buffer));
            goto theend;
        }
     }
@@ -1986,7 +1986,7 @@ do_write(exarg_T *eap)
            else
 #endif
            {
-               emsg(_("E140: Use ! to write partial buffer"));
+               emsg(_(e_use_bang_to_write_partial_buffer));
                goto theend;
            }
        }
@@ -2268,8 +2268,7 @@ do_wqall(exarg_T *eap)
 #endif
            if (buf->b_ffname == NULL)
            {
-               semsg(_("E141: No file name for buffer %ld"),
-                                                           (long)buf->b_fnum);
+               semsg(_(e_no_file_name_for_buffer_nr), (long)buf->b_fnum);
                ++error;
            }
            else if (check_readonly(&eap->forceit, buf)
@@ -2309,7 +2308,7 @@ not_writing(void)
 {
     if (p_write)
        return FALSE;
-    emsg(_("E142: File not written: Writing is disabled by 'write' option"));
+    emsg(_(e_file_not_written_writing_is_disabled_by_write_option));
     return TRUE;
 }
 
@@ -3237,8 +3236,8 @@ theend:
     static void
 delbuf_msg(char_u *name)
 {
-    semsg(_("E143: Autocommands unexpectedly deleted new buffer %s"),
-           name == NULL ? (char_u *)"" : name);
+    semsg(_(e_autocommands_unexpectedly_deleted_new_buffer_str),
+                                          name == NULL ? (char_u *)"" : name);
     vim_free(name);
     au_new_curbuf.br_buf = NULL;
     au_new_curbuf.br_buf_free_count = 0;
@@ -3471,7 +3470,7 @@ ex_z(exarg_T *eap)
     {
        if (!VIM_ISDIGIT(*x))
        {
-           emsg(_("E144: non-numeric argument to :z"));
+           emsg(_(e_non_numeric_argument_to_z));
            return;
        }
        else
@@ -3581,7 +3580,7 @@ check_restricted(void)
 {
     if (restricted)
     {
-       emsg(_("E145: Shell commands and some functionality not allowed in rvim"));
+       emsg(_(e_shell_commands_and_some_functionality_not_allowed_in_rvim));
        return TRUE;
     }
     return FALSE;
@@ -3660,7 +3659,7 @@ check_regexp_delim(int c)
 {
     if (isalpha(c))
     {
-       emsg(_("E146: Regular expressions can't be delimited by letters"));
+       emsg(_(e_regular_expressions_cant_be_delimited_by_letters));
        return FAIL;
     }
     return OK;
@@ -4899,7 +4898,7 @@ ex_global(exarg_T *eap)
                                  || eap->line2 != curbuf->b_ml.ml_line_count))
     {
        // will increment global_busy to break out of the loop
-       emsg(_("E147: Cannot do :global recursive with a range"));
+       emsg(_(e_cannot_do_global_recursive_with_range));
        return;
     }
 
@@ -4937,7 +4936,7 @@ ex_global(exarg_T *eap)
     }
     else if (*cmd == NUL)
     {
-       emsg(_("E148: Regular expression missing from global"));
+       emsg(_(e_regular_expression_missing_from_global));
        return;
     }
     else if (check_regexp_delim(*cmd) == FAIL)
index 038d680e2f037733e654e5b58af36c04ed26ee52..a7e98450ce275244579957e287a2e7bd515b1525 100644 (file)
@@ -1740,7 +1740,6 @@ EXTERN char e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxmem
 EXTERN char e_emptybuf[]       INIT(= N_("E749: empty buffer"));
 
 EXTERN char e_invalpat[]       INIT(= N_("E682: Invalid search pattern or delimiter"));
-EXTERN char e_bufloaded[]      INIT(= N_("E139: File is loaded in another buffer"));
 #if defined(FEAT_SYN_HL) || defined(FEAT_COMPL_FUNC)
 EXTERN char e_notset[] INIT(= N_("E764: Option '%s' is not set"));
 #endif
index d67f78b08ecb6f31d128cf0f8991b733c89b593a..bb9fc8eecd78eab6cf41a6948e700d7798e76d57 100644 (file)
@@ -107,7 +107,7 @@ ex_help(exarg_T *eap)
            semsg(_("E661: Sorry, no '%s' help for %s"), lang, arg);
        else
 #endif
-           semsg(_("E149: Sorry, no help for %s"), arg);
+           semsg(_(e_sorry_no_help_for_str), arg);
        if (n != FAIL)
            FreeWild(num_matches, matches);
        return;
@@ -982,7 +982,7 @@ helptags_one(
            || filecount == 0)
     {
        if (!got_int)
-           semsg(_("E151: No match: %s"), NameBuff);
+           semsg(_(e_no_match_str), NameBuff);
        return;
     }
 
@@ -995,7 +995,7 @@ helptags_one(
     if (fd_tags == NULL)
     {
        if (!ignore_writeerr)
-           semsg(_("E152: Cannot open %s for writing"), NameBuff);
+           semsg(_(e_cannot_open_str_for_writing), NameBuff);
        FreeWild(filecount, files);
        return;
     }
@@ -1028,7 +1028,7 @@ helptags_one(
        fd = mch_fopen((char *)files[fi], "r");
        if (fd == NULL)
        {
-           semsg(_("E153: Unable to open %s for reading"), files[fi]);
+           semsg(_(e_unable_to_open_str_for_reading), files[fi]);
            continue;
        }
        fname = files[fi] + dirlen + 1;
@@ -1136,7 +1136,7 @@ helptags_one(
                {
                    *p2 = NUL;
                    vim_snprintf((char *)NameBuff, MAXPATHL,
-                           _("E154: Duplicate tag \"%s\" in file %s/%s"),
+                           _(e_duplicate_tag_str_in_file_str_str),
                                     ((char_u **)ga.ga_data)[i], dir, p2 + 1);
                    emsg((char *)NameBuff);
                    *p2 = '\t';
@@ -1316,7 +1316,7 @@ ex_helptags(exarg_T *eap)
        dirname = ExpandOne(&xpc, eap->arg, NULL,
                            WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
        if (dirname == NULL || !mch_isdir(dirname))
-           semsg(_("E150: Not a directory: %s"), eap->arg);
+           semsg(_(e_not_a_directory_str), eap->arg);
        else
            do_helptags(dirname, add_help_tags, FALSE);
        vim_free(dirname);
index 50210d092da0e0c005b00c463a0833e062ecf601..ba1ff0e40ad1c7ef48ebd2cf884c6c25db702cf6 100644 (file)
@@ -1140,7 +1140,7 @@ sign_undefine_by_name(char_u *name, int give_error)
     if (sp == NULL)
     {
        if (give_error)
-           semsg(_("E155: Unknown sign: %s"), name);
+           semsg(_(e_unknown_sign_str), name);
        return FAIL;
     }
     sign_undefine(sp, sp_prev);
@@ -1160,7 +1160,7 @@ sign_list_by_name(char_u *name)
     if (sp != NULL)
        sign_list_defined(sp);
     else
-       semsg(_("E155: Unknown sign: %s"), name);
+       semsg(_(e_unknown_sign_str), name);
 }
 
     static void
@@ -1200,7 +1200,7 @@ sign_place(
            break;
     if (sp == NULL)
     {
-       semsg(_("E155: Unknown sign: %s"), sign_name);
+       semsg(_(e_unknown_sign_str), sign_name);
        return FAIL;
     }
     if (*sign_id == 0)
@@ -1277,7 +1277,7 @@ sign_unplace_at_cursor(char_u *groupname)
     if (id > 0)
        sign_unplace(id, groupname, curwin->w_buffer, curwin->w_cursor.lnum);
     else
-       emsg(_("E159: Missing sign number"));
+       emsg(_(e_missing_sign_number));
 }
 
 /*
@@ -1290,7 +1290,7 @@ sign_jump(int sign_id, char_u *sign_group, buf_T *buf)
 
     if ((lnum = buf_findsign(buf, sign_id, sign_group)) <= 0)
     {
-       semsg(_("E157: Invalid sign ID: %d"), sign_id);
+       semsg(_(e_invalid_sign_id_nr), sign_id);
        return -1;
     }
 
@@ -1643,7 +1643,7 @@ parse_sign_cmd_args(
 
     if (filename != NULL && *buf == NULL)
     {
-       semsg(_("E158: Invalid buffer name: %s"), filename);
+       semsg(_(e_invalid_buffer_name_str), filename);
        return FAIL;
     }
 
@@ -1673,7 +1673,7 @@ ex_sign(exarg_T *eap)
     idx = sign_cmd_idx(arg, p);
     if (idx == SIGNCMD_LAST)
     {
-       semsg(_("E160: Unknown sign command: %s"), arg);
+       semsg(_(e_unknown_sign_command_str), arg);
        return;
     }
     arg = skipwhite(p);
@@ -1688,7 +1688,7 @@ ex_sign(exarg_T *eap)
                sign_list_defined(sp);
        }
        else if (*arg == NUL)
-           emsg(_("E156: Missing sign name"));
+           emsg(_(e_missing_sign_name));
        else
        {
            char_u      *name;
index 14ea7ab0de76e06fda6043ca793900eaa6aa751d..03da272cd369e78059e34bee2199793f0294ff22 100644 (file)
@@ -6240,7 +6240,7 @@ spell_add_word(
            buf = NULL;
        if (buf != NULL && bufIsChanged(buf))
        {
-           emsg(_(e_bufloaded));
+           emsg(_(e_file_is_loaded_in_another_buffer));
            vim_free(fnamebuf);
            return;
        }
index 9c1725240a21f4caf354b9eae30bd1d9b0f44190..8505282d7307eea920ace460d9680451be6b8f4a 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3955,
 /**/
     3954,
 /**/