Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
EXTERN char e_didnt_get_block_nr_two[]
INIT(= N_("E298: Didn't get block nr 2?"));
// E299 unused
-
+EXTERN char e_swap_file_already_exists_symlink_attack[]
+ INIT(= N_("E300: Swap file already exists (symlink attack?)"));
+EXTERN char e_oops_lost_the_swap_file[]
+ INIT(= N_("E301: Oops, lost the swap file!!!"));
+EXTERN char e_could_not_rename_swap_file[]
+ INIT(= N_("E302: Could not rename swap file"));
+EXTERN char e_unable_to_open_swap_file_for_str_recovery_impossible[]
+ INIT(= N_("E303: Unable to open swap file for \"%s\", recovery impossible"));
+EXTERN char e_ml_upd_block0_didnt_get_block_zero[]
+ INIT(= N_("E304: ml_upd_block0(): Didn't get block 0??"));
+EXTERN char e_no_swap_file_found_for_str[]
+ INIT(= N_("E305: No swap file found for %s"));
+EXTERN char e_cannot_open_str[]
+ INIT(= N_("E306: Cannot open %s"));
+EXTERN char e_str_does_not_look_like_vim_swap_file[]
+ INIT(= N_("E307: %s does not look like a Vim swap file"));
+EXTERN char e_warning_original_file_may_have_been_changed[]
+ INIT(= N_("E308: Warning: Original file may have been changed"));
+EXTERN char e_unable_to_read_block_one_from_str[]
+ INIT(= N_("E309: Unable to read block 1 from %s"));
+EXTERN char e_block_one_id_wrong_str_not_swp_file[]
+ INIT(= N_("E310: Block 1 ID wrong (%s not a .swp file?)"));
+EXTERN char e_recovery_interrupted[]
+ INIT(= N_("E311: Recovery Interrupted"));
+EXTERN char e_errors_detected_while_recovering_look_for_lines_starting_with_questions[]
+ INIT(= N_("E312: Errors detected while recovering; look for lines starting with ???"));
+EXTERN char e_cannot_preserve_there_is_no_swap_file[]
+ INIT(= N_("E313: Cannot preserve, there is no swap file"));
+EXTERN char e_preserve_failed[]
+ INIT(= N_("E314: Preserve failed"));
+EXTERN char e_ml_get_invalid_lnum_nr[]
+ INIT(= N_("E315: ml_get: invalid lnum: %ld"));
+EXTERN char e_ml_get_cannot_find_line_nr_in_buffer_nr_str[]
+ INIT(= N_("E316: ml_get: cannot find line %ld in buffer %d %s"));
+EXTERN char e_pointer_block_id_wrong[]
+ INIT(= N_("E317: pointer block id wrong"));
+EXTERN char e_pointer_block_id_wrong_two[]
+ INIT(= N_("E317: pointer block id wrong 2"));
+EXTERN char e_pointer_block_id_wrong_three[]
+ INIT(= N_("E317: pointer block id wrong 3"));
+EXTERN char e_pointer_block_id_wrong_four[]
+ INIT(= N_("E317: pointer block id wrong 4"));
+EXTERN char e_updated_too_many_blocks[]
+ INIT(= N_("E318: Updated too many blocks?"));
+EXTERN char e_sorry_command_is_not_available_in_this_version[]
+ INIT(= N_("E319: Sorry, the command is not available in this version"));
+EXTERN char e_cannot_find_line_nr[]
+ INIT(= N_("E320: Cannot find line %ld"));
+EXTERN char e_could_not_reload_str[]
+ INIT(= N_("E321: Could not reload \"%s\""));
+EXTERN char e_line_number_out_of_range_nr_past_the_end[]
+ INIT(= N_("E322: line number out of range: %ld past the end"));
+EXTERN char e_line_count_wrong_in_block_nr[]
+ INIT(= N_("E323: line count wrong in block %ld"));
+#ifdef FEAT_POSTSCRIPT
+EXTERN char e_cant_open_postscript_output_file[]
+ INIT(= N_("E324: Can't open PostScript output file"));
+#endif
+EXTERN char e_attention[]
+ INIT(= N_("E325: ATTENTION"));
+EXTERN char e_too_many_swap_files_found[]
+ INIT(= N_("E326: Too many swap files found"));
+EXTERN char_u e_part_of_menu_item_path_is_not_sub_menu[]
+ INIT(= N_("E327: Part of menu-item path is not sub-menu"));
#ifdef FEAT_MENU
EXTERN char e_menu_only_exists_in_another_mode[]
INIT(= N_("E328: Menu only exists in another mode"));
#endif
+EXTERN char_u e_no_menu_str[]
+ INIT(= N_("E329: No menu \"%s\""));
+EXTERN char e_menu_path_must_not_loead_to_sub_menu[]
+ INIT(= N_("E330: Menu path must not lead to a sub-menu"));
+EXTERN char e_must_not_add_menu_items_directly_to_menu_bar[]
+ INIT(= N_("E331: Must not add menu items directly to menu bar"));
+EXTERN char e_separator_cannot_be_part_of_menu_path[]
+ INIT(= N_("E332: Separator cannot be part of a menu path"));
+EXTERN char e_menu_path_must_lead_to_menu_item[]
+ INIT(= N_("E333: Menu path must lead to a menu item"));
+EXTERN char e_menu_not_found_str[]
+ INIT(= N_("E334: Menu not found: %s"));
+EXTERN char e_menu_not_defined_for_str_mode[]
+ INIT(= N_("E335: Menu not defined for %s mode"));
+EXTERN char e_menu_path_must_lead_to_sub_menu[]
+ INIT(= N_("E336: Menu path must lead to a sub-menu"));
+EXTERN char e_menu_not_found_check_menu_names[]
+ INIT(= N_("E337: Menu not found - check menu names"));
+EXTERN char e_sorry_no_file_browser_in_console_mode[]
+ INIT(= N_("E338: Sorry, no file browser in console mode"));
+EXTERN char e_pattern_too_long[]
+ INIT(= N_("E339: Pattern too long"));
+// E340 unused
EXTERN char e_internal_error_lalloc_zero[]
INIT(= N_("E341: Internal error: lalloc(0, )"));
EXTERN char e_out_of_memory_allocating_nr_bytes[]
INIT(= N_("E342: Out of memory! (allocating %lu bytes)"));
+EXTERN char e_invalid_path_number_must_be_at_end_of_path_or_be_followed_by_str[]
+ INIT(= N_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."));
+EXTERN char e_cant_find_directory_str_in_cdpath[]
+ INIT(= N_("E344: Can't find directory \"%s\" in cdpath"));
+EXTERN char e_cant_find_file_str_in_path[]
+ INIT(= N_("E345: Can't find file \"%s\" in path"));
+EXTERN char e_no_more_directory_str_found_in_cdpath[]
+ INIT(= N_("E346: No more directory \"%s\" found in cdpath"));
+EXTERN char e_no_more_file_str_found_in_path[]
+ INIT(= N_("E347: No more file \"%s\" found in path"));
+EXTERN char e_no_string_under_cursor[]
+ INIT(= N_("E348: No string under cursor"));
+EXTERN char e_no_identifier_under_cursor[]
+ INIT(= N_("E349: No identifier under cursor"));
+
#if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN) \
|| defined(UNIX) || defined(VMS)
EXTERN char e_screen_mode_setting_not_supported[]
{
if (!eap->skip)
eap->errmsg =
- _("E319: Sorry, the command is not available in this version");
+ _(e_sorry_command_is_not_available_in_this_version);
}
#ifdef HAVE_EX_SCRIPT_NI
#if defined(FEAT_EVAL)
if (!aborting())
#endif
- semsg(_("E321: Could not reload \"%s\""), buf->b_fname);
+ semsg(_(e_could_not_reload_str), buf->b_fname);
if (savebuf != NULL && bufref_valid(&bufref) && buf == curbuf)
{
// Put the text back from the save buffer. First
# endif
{
// TODO: non-GUI file selector here
- emsg(_("E338: Sorry, no file browser in console mode"));
+ emsg(_(e_sorry_no_file_browser_in_console_mode));
fname = NULL;
}
wc_part = (char_u *)errpt;
if (*wc_part != NUL && !vim_ispathsep(*wc_part))
{
- semsg(_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."), PATHSEPSTR);
+ semsg(_(e_invalid_path_number_must_be_at_end_of_path_or_be_followed_by_str), PATHSEPSTR);
goto error_return;
}
}
if (first == TRUE)
{
if (find_what == FINDFILE_DIR)
- semsg(_("E344: Can't find directory \"%s\" in cdpath"),
+ semsg(_(e_cant_find_directory_str_in_cdpath),
ff_file_to_find);
else
- semsg(_("E345: Can't find file \"%s\" in path"),
+ semsg(_(e_cant_find_file_str_in_path),
ff_file_to_find);
}
else
{
if (find_what == FINDFILE_DIR)
- semsg(_("E346: No more directory \"%s\" found in cdpath"),
+ semsg(_(e_no_more_directory_str_found_in_cdpath),
ff_file_to_find);
else
- semsg(_("E347: No more file \"%s\" found in path"),
+ semsg(_(e_no_more_file_str_found_in_path),
ff_file_to_find);
}
}
}
if (prt_ps_fd == NULL)
{
- emsg(_("E324: Can't open PostScript output file"));
+ emsg(_(e_cant_open_postscript_output_file));
mch_print_cleanup();
return FAIL;
}
if ((flags & O_CREAT) && mch_lstat((char *)mfp->mf_fname, &sb) >= 0)
{
mfp->mf_fd = -1;
- emsg(_("E300: Swap file already exists (symlink attack?)"));
+ emsg(_(e_swap_file_already_exists_symlink_attack));
}
else
#endif
if (mfp->mf_fd < 0)
{
// could not (re)open the swap file, what can we do????
- emsg(_("E301: Oops, lost the swap file!!!"));
+ emsg(_(e_oops_lost_the_swap_file));
return;
}
#ifdef HAVE_FD_CLOEXEC
#endif
}
if (!success)
- emsg(_("E302: Could not rename swap file"));
+ emsg(_(e_could_not_rename_swap_file));
}
/*
{
need_wait_return = TRUE; // call wait_return later
++no_wait_return;
- (void)semsg(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
+ (void)semsg(_(e_unable_to_open_swap_file_for_str_recovery_impossible),
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname);
--no_wait_return;
}
b0p = (ZERO_BL *)(hp->bh_data);
if (ml_check_b0_id(b0p) == FAIL)
- iemsg(_("E304: ml_upd_block0(): Didn't get block 0??"));
+ iemsg(_(e_ml_upd_block0_didnt_get_block_zero));
else
{
if (what == UB_FNAME)
len = recover_names(fname, FALSE, 0, NULL);
if (len == 0) // no swap files found
{
- semsg(_("E305: No swap file found for %s"), fname);
+ semsg(_(e_no_swap_file_found_for_str), fname);
goto theend;
}
if (len == 1) // one swap file found, use it
if (mfp == NULL || mfp->mf_fd < 0)
{
if (fname_used != NULL)
- semsg(_("E306: Cannot open %s"), fname_used);
+ semsg(_(e_cannot_open_str), fname_used);
goto theend;
}
buf->b_ml.ml_mfp = mfp;
}
if (ml_check_b0_id(b0p) == FAIL)
{
- semsg(_("E307: %s does not look like a Vim swap file"), mfp->mf_fname);
+ semsg(_(e_str_does_not_look_like_vim_swap_file), mfp->mf_fname);
goto theend;
}
if (b0_magic_wrong(b0p))
&& ((mch_stat((char *)mfp->mf_fname, &swp_stat) != -1
&& org_stat.st_mtime > swp_stat.st_mtime)
|| org_stat.st_mtime != mtime))
- emsg(_("E308: Warning: Original file may have been changed"));
+ emsg(_(e_warning_original_file_may_have_been_changed));
out_flush();
// Get the 'fileformat' and 'fileencoding' from block zero.
{
if (bnum == 1)
{
- semsg(_("E309: Unable to read block 1 from %s"), mfp->mf_fname);
+ semsg(_(e_unable_to_read_block_one_from_str), mfp->mf_fname);
goto theend;
}
++error;
{
if (bnum == 1)
{
- semsg(_("E310: Block 1 ID wrong (%s not a .swp file?)"),
+ semsg(_(e_block_one_id_wrong_str_not_swp_file),
mfp->mf_fname);
goto theend;
}
recoverymode = FALSE;
if (got_int)
- emsg(_("E311: Recovery Interrupted"));
+ emsg(_(e_recovery_interrupted));
else if (error)
{
++no_wait_return;
msg(">>>>>>>>>>>>>");
- emsg(_("E312: Errors detected while recovering; look for lines starting with ???"));
+ emsg(_(e_errors_detected_while_recovering_look_for_lines_starting_with_questions));
--no_wait_return;
msg(_("See \":help E312\" for more information."));
msg(">>>>>>>>>>>>>");
if (mfp == NULL || mfp->mf_fname == NULL)
{
if (message)
- emsg(_("E313: Cannot preserve, there is no swap file"));
+ emsg(_(e_cannot_preserve_there_is_no_swap_file));
return;
}
if (status == OK)
msg(_("File preserved"));
else
- emsg(_("E314: Preserve failed"));
+ emsg(_(e_preserve_failed));
}
}
// Avoid giving this message for a recursive call, may happen when
// the GUI redraws part of the text.
++recursive;
- siemsg(_("E315: ml_get: invalid lnum: %ld"), lnum);
+ siemsg(_(e_ml_get_invalid_lnum_nr), lnum);
--recursive;
}
errorret:
++recursive;
get_trans_bufname(buf);
shorten_dir(NameBuff);
- siemsg(_("E316: ml_get: cannot find line %ld in buffer %d %s"),
+ siemsg(_(e_ml_get_cannot_find_line_nr_in_buffer_nr_str),
lnum, buf->b_fnum, NameBuff);
--recursive;
}
pp = (PTR_BL *)(hp->bh_data); // must be pointer block
if (pp->pb_id != PTR_ID)
{
- iemsg(_("E317: pointer block id wrong 3"));
+ iemsg(_(e_pointer_block_id_wrong_three));
mf_put(mfp, hp, FALSE, FALSE);
goto theend;
}
*/
if (stack_idx < 0)
{
- iemsg(_("E318: Updated too many blocks?"));
+ iemsg(_(e_updated_too_many_blocks));
buf->b_ml.ml_stack_top = 0; // invalidate stack
}
}
pp = (PTR_BL *)(hp->bh_data); // must be pointer block
if (pp->pb_id != PTR_ID)
{
- iemsg(_("E317: pointer block id wrong 4"));
+ iemsg(_(e_pointer_block_id_wrong_four));
mf_put(mfp, hp, FALSE, FALSE);
goto theend;
}
hp = ml_find_line(buf, lnum, ML_FIND);
if (hp == NULL)
- siemsg(_("E320: Cannot find line %ld"), lnum);
+ siemsg(_(e_cannot_find_line_nr), lnum);
else
{
dp = (DATA_BL *)(hp->bh_data);
pp = (PTR_BL *)(dp); // must be pointer block
if (pp->pb_id != PTR_ID)
{
- iemsg(_("E317: pointer block id wrong"));
+ iemsg(_(e_pointer_block_id_wrong));
goto error_block;
}
if (idx >= (int)pp->pb_count) // past the end: something wrong!
{
if (lnum > buf->b_ml.ml_line_count)
- siemsg(_("E322: line number out of range: %ld past the end"),
+ siemsg(_(e_line_number_out_of_range_nr_past_the_end),
lnum - buf->b_ml.ml_line_count);
else
- siemsg(_("E323: line count wrong in block %ld"), bnum);
+ siemsg(_(e_line_count_wrong_in_block_nr), bnum);
goto error_block;
}
if (action == ML_DELETE)
if (pp->pb_id != PTR_ID)
{
mf_put(mfp, hp, FALSE, FALSE);
- iemsg(_("E317: pointer block id wrong 2"));
+ iemsg(_(e_pointer_block_id_wrong_two));
break;
}
pp->pb_pointer[ip->ip_index].pe_line_count += count;
time_t swap_mtime;
++no_wait_return;
- (void)emsg(_("E325: ATTENTION"));
+ (void)emsg(_(e_attention));
msg_puts(_("\nFound a swap file by the name \""));
msg_home_replace(fname);
msg_puts("\"\n");
{
if (fname[n - 2] == 'a') // ".saa": tried enough, give up
{
- emsg(_("E326: Too many swap files found"));
+ emsg(_(e_too_many_swap_files_found));
VIM_CLEAR(fname);
break;
}
// The character for each menu mode
static char *menu_mode_chars[] = {"n", "v", "s", "o", "i", "c", "tl", "t"};
-static char_u e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu");
-static char_u e_nomenu[] = N_("E329: No menu \"%s\"");
-
#ifdef FEAT_TOOLBAR
static const char *toolbar_names[] =
{
if (*next_name == NUL && menu->children != NULL)
{
if (!sys_menu)
- emsg(_("E330: Menu path must not lead to a sub-menu"));
+ emsg(_(e_menu_path_must_not_loead_to_sub_menu));
goto erret;
}
if (*next_name != NUL && menu->children == NULL
)
{
if (!sys_menu)
- emsg(_(e_notsubmenu));
+ emsg(_(e_part_of_menu_item_path_is_not_sub_menu));
goto erret;
}
break;
{
if (*next_name == NUL && parent == NULL)
{
- emsg(_("E331: Must not add menu items directly to menu bar"));
+ emsg(_(e_must_not_add_menu_items_directly_to_menu_bar));
goto erret;
}
if (menu_is_separator(dname) && *next_name != NUL)
{
- emsg(_("E332: Separator cannot be part of a menu path"));
+ emsg(_(e_separator_cannot_be_part_of_menu_path));
goto erret;
}
{
if (menu->children == NULL)
{
- emsg(_(e_notsubmenu));
+ emsg(_(e_part_of_menu_item_path_is_not_sub_menu));
return FAIL;
}
if (menu_nable_recurse(menu->children, p, modes, enable)
}
if (*name != NUL && *name != '*' && menu == NULL)
{
- semsg(_(e_nomenu), name);
+ semsg(_(e_no_menu_str), name);
return FAIL;
}
if (*p != NUL && menu->children == NULL)
{
if (!silent)
- emsg(_(e_notsubmenu));
+ emsg(_(e_part_of_menu_item_path_is_not_sub_menu));
return FAIL;
}
if ((menu->modes & modes) != 0x0)
if (menu == NULL)
{
if (!silent)
- semsg(_(e_nomenu), name);
+ semsg(_(e_no_menu_str), name);
return FAIL;
}
// Found menu
if (*p != NUL && menu->children == NULL)
{
- emsg(_(e_notsubmenu));
+ emsg(_(e_part_of_menu_item_path_is_not_sub_menu));
vim_free(path_name);
return FAIL;
}
}
if (menu == NULL)
{
- semsg(_(e_nomenu), name);
+ semsg(_(e_no_menu_str), name);
vim_free(path_name);
return FAIL;
}
default:
mode = (char_u *)"Normal";
}
- semsg(_("E335: Menu not defined for %s mode"), mode);
+ semsg(_(e_menu_not_defined_for_str_mode), mode);
}
}
{
if (*p == NUL && menu->children != NULL)
{
- emsg(_("E333: Menu path must lead to a menu item"));
+ emsg(_(e_menu_path_must_lead_to_menu_item));
gave_emsg = TRUE;
menu = NULL;
}
else if (*p != NUL && menu->children == NULL)
{
- emsg(_(e_notsubmenu));
+ emsg(_(e_part_of_menu_item_path_is_not_sub_menu));
menu = NULL;
}
break;
if (menu == NULL)
{
if (!gave_emsg)
- semsg(_("E334: Menu not found: %s"), name_arg);
+ semsg(_(e_menu_not_found_str), name_arg);
return NULL;
}
{
// found a menu item instead of a sub-menu
if (*p == NUL)
- emsg(_("E336: Menu path must lead to a sub-menu"));
+ emsg(_(e_menu_path_must_lead_to_sub_menu));
else
- emsg(_(e_notsubmenu));
+ emsg(_(e_part_of_menu_item_path_is_not_sub_menu));
menu = NULL;
goto theend;
}
}
if (menu == NULL)
- emsg(_("E337: Menu not found - check menu names"));
+ emsg(_(e_menu_not_found_check_menu_names));
theend:
vim_free(saved_name);
return menu;
#endif
static void nv_cursorhold(cmdarg_T *cap);
-static char *e_noident = N_("E349: No identifier under cursor");
-
/*
* Function to be called for a Normal or Visual mode command.
* The argument is a cmdarg_T.
if ((find_type & FIND_NOERROR) == 0)
{
if (find_type & FIND_STRING)
- emsg(_("E348: No string under cursor"));
+ emsg(_(e_no_string_under_cursor));
else
- emsg(_(e_noident));
+ emsg(_(e_no_identifier_under_cursor));
}
return 0;
}
|| STRCMP(kp, ":help") == 0);
if (kp_help && *skipwhite(ptr) == NUL)
{
- emsg(_(e_noident)); // found white space only
+ emsg(_(e_no_identifier_under_cursor)); // found white space only
return;
}
kp_ex = (*kp == ':');
}
if (n == 0)
{
- emsg(_(e_noident)); // found dashes only
+ // found dashes only
+ emsg(_(e_no_identifier_under_cursor));
vim_free(buf);
return;
}
{
vim_free(r);
if (reg_toolong)
- EMSG_RET_NULL(_("E339: Pattern too long"));
+ EMSG_RET_NULL(_(e_pattern_too_long));
return NULL;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3983,
/**/
3982,
/**/