Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
if (argn < 0 || argn >= ARGCOUNT)
{
if (ARGCOUNT <= 1)
- emsg(_("E163: There is only one file to edit"));
+ emsg(_(e_there_is_only_one_file_to_edit));
else if (argn < 0)
- emsg(_("E164: Cannot go before first file"));
+ emsg(_(e_cannot_go_before_first_file));
else
- emsg(_("E165: Cannot go beyond last file"));
+ emsg(_(e_cannot_go_beyond_last_file));
}
else
{
|| (mch_lstat((char *)fname, &st) == 0
&& (st.st_dev != st_old.st_dev
|| st.st_ino != st_old.st_ino)))
- errmsg = (char_u *)_("E166: Can't open linked file for writing");
+ errmsg =
+ (char_u *)_(e_cant_open_linked_file_for_writing);
else
#endif
{
INIT(= N_("E121: Undefined variable: %s"));
EXTERN char e_undefined_variable_char_str[]
INIT(= N_("E121: Undefined variable: %c:%s"));
-EXTERN char e_function_str_already_exists_add_excl_to_replace[]
+EXTERN char e_function_str_already_exists_add_bang_to_replace[]
INIT(= N_("E122: Function %s already exists, add ! to replace it"));
EXTERN char e_undefined_function_str[]
INIT(= N_("E123: Undefined function: %s"));
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[]
+EXTERN char e_cannot_open_str_for_writing_1[]
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_breakpoint_not_found_str[]
INIT(= N_("E161: Breakpoint not found: %s"));
#endif
-
+EXTERN char e_no_write_since_last_change_for_buffer_str[]
+ INIT(= N_("E162: No write since last change for buffer \"%s\""));
+EXTERN char e_there_is_only_one_file_to_edit[]
+ INIT(= N_("E163: There is only one file to edit"));
+EXTERN char e_cannot_go_before_first_file[]
+ INIT(= N_("E164: Cannot go before first file"));
+EXTERN char e_cannot_go_beyond_last_file[]
+ INIT(= N_("E165: Cannot go beyond last file"));
+EXTERN char e_cant_open_linked_file_for_writing[]
+ INIT(= N_("E166: Can't open linked file for writing"));
+EXTERN char e_scriptencoding_used_outside_of_sourced_file[]
+ INIT(= N_("E167: :scriptencoding used outside of a sourced file"));
+EXTERN char e_finish_used_outside_of_sourced_file[]
+ INIT(= N_("E168: :finish used outside of a sourced file"));
+EXTERN char e_command_too_recursive[]
+ INIT(= N_("E169: Command too recursive"));
+EXTERN char e_missing_endwhile[]
+ INIT(= N_("E170: Missing :endwhile"));
+EXTERN char e_missing_endfor[]
+ INIT(= N_("E170: Missing :endfor"));
+EXTERN char e_missing_endif[]
+ INIT(= N_("E171: Missing :endif"));
+EXTERN char e_missing_marker[]
+ INIT(= N_("E172: Missing marker"));
+EXTERN char e_nr_more_file_to_edit[]
+ INIT(= N_("E173: %d more file to edit"));
+EXTERN char e_nr_more_files_to_edit[]
+ INIT(= N_("E173: %d more files to edit"));
+EXTERN char e_command_already_exists_add_bang_to_replace_it_str[]
+ INIT(= N_("E174: Command already exists: add ! to replace it: %s"));
+EXTERN char e_no_attribute_specified[]
+ INIT(= N_("E175: No attribute specified"));
+EXTERN char e_invalid_number_of_arguments[]
+ INIT(= N_("E176: Invalid number of arguments"));
+EXTERN char e_count_cannot_be_specified_twice[]
+ INIT(= N_("E177: Count cannot be specified twice"));
+EXTERN char e_invalid_default_value_for_count[]
+ INIT(= N_("E178: Invalid default value for count"));
+EXTERN char e_argument_required_for_str[]
+ INIT(= N_("E179: argument required for %s"));
+EXTERN char e_invalid_complete_value_str[]
+ INIT(= N_("E180: Invalid complete value: %s"));
+EXTERN char e_invalid_attribute_str[]
+ INIT(= N_("E181: Invalid attribute: %s"));
+EXTERN char e_invalid_command_name[]
+ INIT(= N_("E182: Invalid command name"));
+EXTERN char e_user_defined_commands_must_start_with_an_uppercase_letter[]
+ INIT(= N_("E183: User defined commands must start with an uppercase letter"));
EXTERN char e_no_such_user_defined_command_str[]
INIT(= N_("E184: No such user-defined command: %s"));
+EXTERN char e_cannot_find_color_scheme_str[]
+ INIT(= N_("E185: Cannot find color scheme '%s'"));
+EXTERN char e_no_previous_directory[]
+ INIT(= N_("E186: No previous directory"));
+EXTERN char e_directory_unknown[]
+ INIT(= N_("E187: Directory unknown"));
+EXTERN char e_obtaining_window_position_not_implemented_for_this_platform[]
+ INIT(= N_("E188: Obtaining window position not implemented for this platform"));
+EXTERN char e_str_exists_add_bang_to_override[]
+ INIT(= N_("E189: \"%s\" exists (add ! to override)"));
+EXTERN char e_cannot_open_str_for_writing_2[]
+ INIT(= N_("E190: Cannot open \"%s\" for writing"));
+
+
#ifndef FEAT_DIGRAPHS
EXTERN char e_no_digraphs_version[]
INIT(= N_("E196: No digraphs in this version"));
marker = dot;
else
{
- emsg(_("E172: Missing marker"));
+ emsg(_(e_missing_marker));
return NULL;
}
}
buf->b_fname)
:
#endif
- semsg(_("E162: No write since last change for buffer \"%s\""),
+ semsg(_(e_no_write_since_last_change_for_buffer_str),
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname))
{
save = no_wait_return;
#endif
)
{
- emsg(_("E169: Command too recursive"));
+ emsg(_(e_command_too_recursive));
#ifdef FEAT_EVAL
// When converting to an exception, we do not include the command name
// since this is not an error of the specific command.
if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY)
emsg(_(e_endtry));
else if (cstack.cs_flags[cstack.cs_idx] & CSF_WHILE)
- emsg(_(e_endwhile));
+ emsg(_(e_missing_endwhile));
else if (cstack.cs_flags[cstack.cs_idx] & CSF_FOR)
- emsg(_(e_endfor));
+ emsg(_(e_missing_endfor));
else
- emsg(_(e_endif));
+ emsg(_(e_missing_endif));
}
/*
return FAIL;
}
#endif
- semsg(NGETTEXT("E173: %d more file to edit",
- "E173: %d more files to edit", n), n);
+ semsg(NGETTEXT(e_nr_more_file_to_edit,
+ e_nr_more_files_to_edit , n), n);
quitmore = 2; // next try to quit is allowed
}
return FAIL;
#endif
}
else if (load_colors(eap->arg) == FAIL)
- semsg(_("E185: Cannot find color scheme '%s'"), eap->arg);
+ semsg(_(e_cannot_find_color_scheme_str), eap->arg);
#ifdef FEAT_VTP
else if (has_vtp_working())
pdir = get_prevdir(scope);
if (pdir == NULL)
{
- emsg(_("E186: No previous directory"));
+ emsg(_(e_no_previous_directory));
return FALSE;
}
new_dir = pdir;
msg((char *)NameBuff);
}
else
- emsg(_("E187: Unknown"));
+ emsg(_(e_directory_unknown));
}
/*
}
else
# endif
- emsg(_("E188: Obtaining window position not implemented for this platform"));
+ emsg(_(e_obtaining_window_position_not_implemented_for_this_platform));
}
else
{
#endif
if (!forceit && *mode != 'a' && vim_fexists(fname))
{
- semsg(_("E189: \"%s\" exists (add ! to override)"), fname);
+ semsg(_(e_str_exists_add_bang_to_override), fname);
return NULL;
}
if ((fd = mch_fopen((char *)fname, mode)) == NULL)
- semsg(_("E190: Cannot open \"%s\" for writing"), fname);
+ semsg(_(e_cannot_open_str_for_writing_2), fname);
return fd;
}
if (!(fl & (CSF_WHILE | CSF_FOR)))
{
if (!(fl & CSF_TRY))
- eap->errmsg = _(e_endif);
+ eap->errmsg = _(e_missing_endif);
else if (fl & CSF_FINALLY)
eap->errmsg = _(e_endtry);
// Try to find the matching ":while" and report what's missing.
get_end_emsg(cstack_T *cstack)
{
if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
- return _(e_endwhile);
+ return _(e_missing_endwhile);
if (cstack->cs_flags[cstack->cs_idx] & CSF_FOR)
- return _(e_endfor);
- return _(e_endif);
+ return _(e_missing_endfor);
+ return _(e_missing_endif);
}
EXTERN char e_abort[] INIT(= N_("E470: Command aborted"));
EXTERN char e_argreq[] INIT(= N_("E471: Argument required"));
#ifdef FEAT_EVAL
-EXTERN char e_endif[] INIT(= N_("E171: Missing :endif"));
EXTERN char e_catch[] INIT(= N_("E603: :catch without :try"));
EXTERN char e_finally[] INIT(= N_("E606: :finally without :try"));
EXTERN char e_finally_dup[] INIT(= N_("E607: multiple :finally"));
EXTERN char e_endtry[] INIT(= N_("E600: Missing :endtry"));
EXTERN char e_no_endtry[] INIT(= N_("E602: :endtry without :try"));
-EXTERN char e_endwhile[] INIT(= N_("E170: Missing :endwhile"));
-EXTERN char e_endfor[] INIT(= N_("E170: Missing :endfor"));
EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while"));
EXTERN char e_for[] INIT(= N_("E588: :endfor without :for"));
#endif
if (fd_tags == NULL)
{
if (!ignore_writeerr)
- semsg(_(e_cannot_open_str_for_writing), NameBuff);
+ semsg(_(e_cannot_open_str_for_writing_1), NameBuff);
FreeWild(filecount, files);
return;
}
if (!getline_equal(eap->getline, eap->cookie, getsourceline))
{
- emsg(_("E167: :scriptencoding used outside of a sourced file"));
+ emsg(_(e_scriptencoding_used_outside_of_sourced_file));
return;
}
if (getline_equal(eap->getline, eap->cookie, getsourceline))
do_finish(eap, FALSE);
else
- emsg(_("E168: :finish used outside of a sourced file"));
+ emsg(_(e_finish_used_outside_of_sourced_file));
}
/*
if (command_complete[i].expand == 0)
{
- semsg(_("E180: Invalid complete value: %s"), value);
+ semsg(_(e_invalid_complete_value_str), value);
return FAIL;
}
if (len == 0)
{
- emsg(_("E175: No attribute specified"));
+ emsg(_(e_no_attribute_specified));
return FAIL;
}
else
{
wrong_nargs:
- emsg(_("E176: Invalid number of arguments"));
+ emsg(_(e_invalid_number_of_arguments));
return FAIL;
}
}
if (*def >= 0)
{
two_count:
- emsg(_("E177: Count cannot be specified twice"));
+ emsg(_(e_count_cannot_be_specified_twice));
return FAIL;
}
if (p != val + vallen || vallen == 0)
{
invalid_count:
- emsg(_("E178: Invalid default value for count"));
+ emsg(_(e_invalid_default_value_for_count));
return FAIL;
}
}
{
if (val == NULL)
{
- emsg(_("E179: argument required for -complete"));
+ semsg(_(e_argument_required_for_str), "-complete");
return FAIL;
}
*argt |= EX_RANGE;
if (val == NULL)
{
- emsg(_("E179: argument required for -addr"));
+ semsg(_(e_argument_required_for_str), "-addr");
return FAIL;
}
if (parse_addr_type_arg(val, (int)vallen, addr_type_arg) == FAIL)
{
char_u ch = attr[len];
attr[len] = '\0';
- semsg(_("E181: Invalid attribute: %s"), attr);
+ semsg(_(e_invalid_attribute_str), attr);
attr[len] = ch;
return FAIL;
}
#endif
)
{
- semsg(_("E174: Command already exists: add ! to replace it: %s"),
+ semsg(_(e_command_already_exists_add_bang_to_replace_it_str),
name);
goto fail;
}
++p;
if (!ends_excmd2(eap->arg, p) && !VIM_ISWHITE(*p))
{
- emsg(_("E182: Invalid command name"));
+ emsg(_(e_invalid_command_name));
return;
}
end = p;
if (!has_attr && ends_excmd2(eap->arg, p))
uc_list(name, end - name);
else if (!ASCII_ISUPPER(*name))
- emsg(_("E183: User defined commands must start with an uppercase letter"));
+ emsg(_(e_user_defined_commands_must_start_with_an_uppercase_letter));
else if ((name_len == 1 && *name == 'X')
|| (name_len <= 4
&& STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0))
if (fp != NULL)
{
// TODO: handle ! to overwrite
- semsg(_(e_function_str_already_exists_add_excl_to_replace), global);
+ semsg(_(e_function_str_already_exists_add_bang_to_replace), global);
return FAIL;
}
if (fudi.fd_dict != NULL && fudi.fd_newkey == NULL)
emsg(_(e_funcdict));
else if (name != NULL && find_func(name, is_global, NULL) != NULL)
- emsg_funcname(e_function_str_already_exists_add_excl_to_replace, name);
+ emsg_funcname(e_function_str_already_exists_add_bang_to_replace, name);
}
if (!eap->skip && did_emsg)
if (vim9script)
emsg_funcname(e_name_already_defined_str, name);
else
- emsg_funcname(e_function_str_already_exists_add_excl_to_replace, name);
+ emsg_funcname(e_function_str_already_exists_add_bang_to_replace, name);
goto erret;
}
if (fp->uf_calls > 0)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3957,
/**/
3956,
/**/
if (scope == NULL)
emsg(_(e_no_endtry));
else if (scope->se_type == WHILE_SCOPE)
- emsg(_(e_endwhile));
+ emsg(_(e_missing_endwhile));
else if (scope->se_type == FOR_SCOPE)
- emsg(_(e_endfor));
+ emsg(_(e_missing_endfor));
else
- emsg(_(e_endif));
+ emsg(_(e_missing_endif));
return NULL;
}
if (cctx.ctx_scope != NULL)
{
if (cctx.ctx_scope->se_type == IF_SCOPE)
- emsg(_(e_endif));
+ emsg(_(e_missing_endif));
else if (cctx.ctx_scope->se_type == WHILE_SCOPE)
- emsg(_(e_endwhile));
+ emsg(_(e_missing_endwhile));
else if (cctx.ctx_scope->se_type == FOR_SCOPE)
- emsg(_(e_endfor));
+ emsg(_(e_missing_endfor));
else
emsg(_(e_missing_rcurly));
goto erret;