Problem: Error messages are spread out.
Solution: Move error messages to errors.h and give them a clear name.
emsg(_("E948: Job still running (add ! to end the job)"));
else
#endif
- emsg(_("E37: No write since last change (add ! to override)"));
+ emsg(_(e_no_write_since_last_change_add_bang_to_override));
}
void
emsg(_("E948: Job still running"));
else
#endif
- emsg(_("E37: No write since last change"));
+ emsg(_(e_no_write_since_last_change));
}
/*
{
if (curbuf->b_ffname == NULL)
{
- emsg(_(e_noname));
+ emsg(_(e_no_file_name));
return FAIL;
}
bp->dbg_type = DBG_FILE;
str = skipwhite(str);
if (!VIM_ISDIGIT(*str))
{
- emsg(_(e_number_exp));
+ emsg(_(e_number_expected));
return;
}
n = getdigits(&str);
buflen = STRLEN(curbuf->b_p_keymap) + STRLEN(p_enc) + 14;
buf = alloc(buflen);
if (buf == NULL)
- return e_outofmem;
+ return e_out_of_memory;
// try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath'
vim_snprintf((char *)buf, buflen, "keymap/%s_%s.vim",
ptr = get_last_insert();
if (ptr == NULL)
{
- emsg(_(e_noinstext));
+ emsg(_(e_no_inserted_text_yet));
return FAIL;
}
INIT(= N_("E23: No alternate file"));
EXTERN char e_no_such_abbreviation[]
INIT(= N_("E24: No such abbreviation"));
+#if !defined(FEAT_GUI) || defined(VIMDLL)
+EXTERN char e_gui_cannot_be_used_not_enabled_at_compile_time[]
+ INIT(= N_("E25: GUI cannot be used: Not enabled at compile time"));
+#endif
+#ifndef FEAT_RIGHTLEFT
+EXTERN char e_hebrew_cannot_be_used_not_enabled_at_compile_time[]
+ INIT(= N_("E26: Hebrew cannot be used: Not enabled at compile time\n"));
+#endif
+EXTERN char e_farsi_support_has_been_removed[]
+ INIT(= N_("E27: Farsi support has been removed\n"));
#ifdef FEAT_EVAL
+#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_SYN_HL)
+EXTERN char e_no_such_highlight_group_name_str[]
+ INIT(= N_("E28: No such highlight group name: %s"));
+#endif
+EXTERN char e_no_inserted_text_yet[]
+ INIT(= N_("E29: No inserted text yet"));
+EXTERN char e_no_previous_command_line[]
+ INIT(= N_("E30: No previous command line"));
+EXTERN char e_no_such_mapping[]
+ INIT(= N_("E31: No such mapping"));
+EXTERN char e_no_file_name[]
+ INIT(= N_("E32: No file name"));
+EXTERN char e_no_previous_substitute_regular_expression[]
+ INIT(= N_("E33: No previous substitute regular expression"));
+EXTERN char e_no_previous_command[]
+ INIT(= N_("E34: No previous command"));
+EXTERN char e_no_previous_regular_expression[]
+ INIT(= N_("E35: No previous regular expression"));
+EXTERN char e_not_enough_room[]
+ INIT(= N_("E36: Not enough room"));
+EXTERN char e_no_write_since_last_change[]
+ INIT(= N_("E37: No write since last change"));
+EXTERN char e_no_write_since_last_change_add_bang_to_override[]
+ INIT(= N_("E37: No write since last change (add ! to override)"));
+EXTERN char e_null_argument[]
+ INIT(= N_("E38: Null argument"));
+#if defined(FEAT_DIGRAPHS) || defined(FEAT_TIMERS) || defined(FEAT_EVAL)
+EXTERN char e_number_expected[]
+ INIT(= N_("E39: Number expected"));
+#endif
+#ifdef FEAT_QUICKFIX
+EXTERN char e_cant_open_errorfile_str[]
+ INIT(= N_("E40: Can't open errorfile %s"));
+#endif
+EXTERN char e_out_of_memory[]
+ INIT(= N_("E41: Out of memory!"));
+#ifdef FEAT_QUICKFIX
+EXTERN char e_no_errors[]
+ INIT(= N_("E42: No Errors"));
+#endif
+EXTERN char e_damaged_match_string[]
+ INIT(= N_("E43: Damaged match string"));
+EXTERN char e_corrupted_regexp_program[]
+ INIT(= N_("E44: Corrupted regexp program"));
+EXTERN char e_readonly_option_is_set_add_bang_to_override[]
+ INIT(= N_("E45: 'readonly' option is set (add ! to override)"));
EXTERN char e_undefined_variable_str[]
INIT(= N_("E121: Undefined variable: %s"));
EXTERN char e_undefined_variable_char_str[]
{
if (last_search_pat() == NULL)
{
- emsg(_(e_noprevre));
+ emsg(_(e_no_previous_regular_expression));
goto sortend;
}
regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
{
if (prevcmd == NULL)
{
- emsg(_(e_noprev));
+ emsg(_(e_no_previous_command));
vim_free(newcmd);
return;
}
else
#endif
if (buf->b_p_ro)
- emsg(_(e_readonly));
+ emsg(_(e_readonly_option_is_set_add_bang_to_override));
else
semsg(_("E505: \"%s\" is read-only (add ! to override)"),
buf->b_fname);
{
if (old_sub == NULL) // there is no previous command
{
- emsg(_(e_nopresub));
+ emsg(_(e_no_previous_substitute_regular_expression));
return;
}
sub = old_sub;
{
if (old_sub == NULL) // there is no previous command
{
- emsg(_(e_nopresub));
+ emsg(_(e_no_previous_substitute_regular_expression));
return;
}
pat = NULL; // search_regcomp() will use previous pattern
{
if (curbuf->b_ffname == NULL)
{
- emsg(_(e_noname));
+ emsg(_(e_no_file_name));
return FAIL;
}
return OK;
next_cmdline = vim_strsave(next_cmdline);
if (next_cmdline == NULL)
{
- emsg(_(e_outofmem));
+ emsg(_(e_out_of_memory));
retval = FAIL;
break;
}
static void
ex_nogui(exarg_T *eap)
{
- eap->errmsg = _(e_nogvim);
+ eap->errmsg = _(e_gui_cannot_be_used_not_enabled_at_compile_time);
}
#endif
if (elem == NULL)
{
suppress_errthrow = TRUE;
- emsg(_(e_outofmem));
+ emsg(_(e_out_of_memory));
}
else
{
{
vim_free(elem);
suppress_errthrow = TRUE;
- emsg(_(e_outofmem));
+ emsg(_(e_out_of_memory));
}
else
{
nomem:
vim_free(excp);
suppress_errthrow = TRUE;
- emsg(_(e_outofmem));
+ emsg(_(e_out_of_memory));
fail:
current_exception = NULL;
return FAIL;
elem = ALLOC_ONE(struct eslist_elem);
if (elem == NULL)
- emsg(_(e_outofmem));
+ emsg(_(e_out_of_memory));
else
{
elem->saved_emsg_silent = emsg_silent;
EXTERN char e_loadfunc[] INIT(= N_("E448: Could not load library function %s"));
#endif
EXTERN char e_nobang[] INIT(= N_("E477: No ! allowed"));
-#if !defined(FEAT_GUI) || defined(VIMDLL)
-EXTERN char e_nogvim[] INIT(= N_("E25: GUI cannot be used: Not enabled at compile time"));
-#endif
-#ifndef FEAT_RIGHTLEFT
-EXTERN char e_nohebrew[] INIT(= N_("E26: Hebrew cannot be used: Not enabled at compile time\n"));
-#endif
-EXTERN char e_nofarsi[] INIT(= N_("E27: Farsi support has been removed\n"));
#ifndef FEAT_ARABIC
EXTERN char e_noarabic[] INIT(= N_("E800: Arabic cannot be used: Not enabled at compile time\n"));
#endif
-#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_SYN_HL)
-EXTERN char e_nogroup[] INIT(= N_("E28: No such highlight group name: %s"));
-#endif
-EXTERN char e_noinstext[] INIT(= N_("E29: No inserted text yet"));
-EXTERN char e_nolastcmd[] INIT(= N_("E30: No previous command line"));
-EXTERN char e_nomap[] INIT(= N_("E31: No such mapping"));
EXTERN char e_nomatch[] INIT(= N_("E479: No match"));
EXTERN char e_nomatch2[] INIT(= N_("E480: No match: %s"));
-EXTERN char e_noname[] INIT(= N_("E32: No file name"));
-EXTERN char e_nopresub[] INIT(= N_("E33: No previous substitute regular expression"));
-EXTERN char e_noprev[] INIT(= N_("E34: No previous command"));
-EXTERN char e_noprevre[] INIT(= N_("E35: No previous regular expression"));
EXTERN char e_norange[] INIT(= N_("E481: No range allowed"));
-EXTERN char e_noroom[] INIT(= N_("E36: Not enough room"));
#ifdef FEAT_CLIENTSERVER
EXTERN char e_noserver[] INIT(= N_("E247: no registered server named \"%s\""));
#endif
EXTERN char e_notmp[] INIT(= N_("E483: Can't get temp file name"));
EXTERN char e_notopen[] INIT(= N_("E484: Can't open file %s"));
EXTERN char e_notread[] INIT(= N_("E485: Can't read file %s"));
-EXTERN char e_null[] INIT(= N_("E38: Null argument"));
-#if defined(FEAT_DIGRAPHS) || defined(FEAT_TIMERS) || defined(FEAT_EVAL)
-EXTERN char e_number_exp[] INIT(= N_("E39: Number expected"));
-#endif
-#ifdef FEAT_QUICKFIX
-EXTERN char e_openerrf[] INIT(= N_("E40: Can't open errorfile %s"));
-#endif
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
EXTERN char e_opendisp[] INIT(= N_("E233: cannot open display"));
#endif
-EXTERN char e_outofmem[] INIT(= N_("E41: Out of memory!"));
EXTERN char e_patnotf[] INIT(= N_("Pattern not found"));
EXTERN char e_patnotf2[] INIT(= N_("E486: Pattern not found: %s"));
EXTERN char e_positive[] INIT(= N_("E487: Argument must be positive"));
#endif
#ifdef FEAT_QUICKFIX
-EXTERN char e_quickfix[] INIT(= N_("E42: No Errors"));
EXTERN char e_loclist[] INIT(= N_("E776: No location list"));
#endif
-EXTERN char e_re_damg[] INIT(= N_("E43: Damaged match string"));
-EXTERN char e_re_corr[] INIT(= N_("E44: Corrupted regexp program"));
-EXTERN char e_readonly[] INIT(= N_("E45: 'readonly' option is set (add ! to override)"));
#ifdef FEAT_EVAL
EXTERN char e_letwrong[] INIT(= N_("E734: Wrong variable type for %s="));
EXTERN char e_illvar[] INIT(= N_("E461: Illegal variable name: %s"));
#if defined(VIMDLL) && !defined(EXPERIMENTAL_GUI_CMD)
if (!gui.starting)
{
- emsg(_(e_nogvim));
+ emsg(_(e_gui_cannot_be_used_not_enabled_at_compile_time));
return;
}
#endif
}
else if (argvars[2].v_type != VAR_NUMBER)
{
- emsg(_(e_number_exp));
+ emsg(_(e_number_expected));
return;
}
else
break;
case 'F': // "-F" was for Farsi mode
- mch_errmsg(_(e_nofarsi));
+ mch_errmsg(_(e_farsi_support_has_been_removed));
mch_exit(2);
break;
p_hkmap = TRUE;
set_option_value((char_u *)"rl", 1L, NULL, 0);
#else
- mch_errmsg(_(e_nohebrew));
+ mch_errmsg(_(e_hebrew_cannot_be_used_not_enabled_at_compile_time));
mch_exit(2);
#endif
break;
#ifdef FEAT_GUI
gui.starting = TRUE; // start GUI a bit later
#else
- mch_errmsg(_(e_nogvim));
+ mch_errmsg(_(e_gui_cannot_be_used_not_enabled_at_compile_time));
mch_errmsg("\n");
mch_exit(2);
#endif
{
case 1: emsg(_(e_invarg));
break;
- case 2: emsg((isabbrev ? _(e_no_such_abbreviation) : _(e_nomap)));
+ case 2: emsg((isabbrev ? _(e_no_such_abbreviation)
+ : _(e_no_such_mapping)));
break;
}
}
}
if ((hlg_id = syn_namen2id(grp, (int)STRLEN(grp))) == 0)
{
- semsg(_(e_nogroup), grp);
+ semsg(_(e_no_such_highlight_group_name_str), grp);
return -1;
}
if (pat != NULL && (regprog = vim_regcomp(pat, RE_MAGIC)) == NULL)
if (efile != NULL && (pstate->fd = mch_fopen((char *)efile, "r")) == NULL)
{
- semsg(_(e_openerrf), efile);
+ semsg(_(e_cant_open_errorfile_str), efile);
return FAIL;
}
if (qf_stack_empty(qi) || qf_list_empty(qf_get_curlist(qi)))
{
- emsg(_(e_quickfix));
+ emsg(_(e_no_errors));
return;
}
if (qf_stack_empty(qi) || qf_list_empty(qf_get_curlist(qi)))
{
- emsg(_(e_quickfix));
+ emsg(_(e_no_errors));
return;
}
if (*arg == '+')
if (qf_list_empty(qf_get_curlist(qi)))
{
- emsg(_(e_quickfix));
+ emsg(_(e_no_errors));
return;
}
buf_has_flag = BUF_HAS_LL_ENTRY;
if (!(curbuf->b_has_qf_entry & buf_has_flag))
{
- emsg(_(e_quickfix));
+ emsg(_(e_no_errors));
return;
}
// check if the list has valid errors
if (!qf_list_has_valid_entries(qfl))
{
- emsg(_(e_quickfix));
+ emsg(_(e_no_errors));
return;
}
// Pattern is empty, use last search pattern.
if (last_search_pat() == NULL)
{
- emsg(_(e_noprevre));
+ emsg(_(e_no_previous_regular_expression));
return;
}
regmatch->regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
if (UCHARAT(((bt_regprog_T *)prog)->program) != REGMAGIC)
{
- emsg(_(e_re_corr));
+ emsg(_(e_corrupted_regexp_program));
return TRUE;
}
return FALSE;
// Be paranoid...
if ((source == NULL && expr == NULL) || dest == NULL)
{
- emsg(_(e_null));
+ emsg(_(e_null_argument));
return 0;
}
if (prog_magic_wrong())
else if (*s == NUL) // we hit NUL.
{
if (copy)
- iemsg(_(e_re_damg));
+ iemsg(_(e_damaged_match_string));
goto exit;
}
else
}
}
else
- EMSG_RET_NULL(_(e_nopresub));
+ EMSG_RET_NULL(_(e_no_previous_substitute_regular_expression));
break;
case Magic('1'):
int flags;
if (expr == NULL)
- IEMSG_RET_NULL(_(e_null));
+ IEMSG_RET_NULL(_(e_null_argument));
init_class_tab();
break;
default: // Oh dear. Called inappropriately.
- iemsg(_(e_re_corr));
+ iemsg(_(e_corrupted_regexp_program));
#ifdef DEBUG
printf("Called regrepeat with op code %d\n", OP(p));
#endif
break;
default:
- iemsg(_(e_re_corr));
+ iemsg(_(e_corrupted_regexp_program));
#ifdef DEBUG
printf("Illegal op code %d\n", op);
#endif
{
// We get here only if there's trouble -- normally "case END" is
// the terminating point.
- iemsg(_(e_re_corr));
+ iemsg(_(e_corrupted_regexp_program));
#ifdef DEBUG
printf("Premature EOL\n");
#endif
// Be paranoid...
if (prog == NULL || line == NULL)
{
- iemsg(_(e_null));
+ iemsg(_(e_null_argument));
goto theend;
}
// Generated as "\%(pattern\)".
if (reg_prev_sub == NULL)
{
- emsg(_(e_nopresub));
+ emsg(_(e_no_previous_substitute_regular_expression));
return FAIL;
}
for (lp = reg_prev_sub; *lp != NUL; MB_CPTR_ADV(lp))
// Be paranoid...
if (prog == NULL || line == NULL)
{
- iemsg(_(e_null));
+ iemsg(_(e_null_argument));
goto theend;
}
{
if (last_cmdline == NULL)
{
- emsg(_(e_nolastcmd));
+ emsg(_(e_no_previous_command_line));
return FAIL;
}
// don't keep the cmdline containing @:
p = get_last_insert_save();
if (p == NULL)
{
- emsg(_(e_noinstext));
+ emsg(_(e_no_inserted_text_yet));
return FAIL;
}
retval = put_in_typebuf(p, FALSE, colon, silent);
case ':': // last command line
if (last_cmdline == NULL && errmsg)
- emsg(_(e_nolastcmd));
+ emsg(_(e_no_previous_command_line));
*argp = last_cmdline;
return TRUE;
case '/': // last search-pattern
if (last_search_pat() == NULL && errmsg)
- emsg(_(e_noprevre));
+ emsg(_(e_no_previous_regular_expression));
*argp = last_search_pat();
return TRUE;
*argp = get_last_insert_save();
*allocated = TRUE;
if (*argp == NULL && errmsg)
- emsg(_(e_noinstext));
+ emsg(_(e_no_inserted_text_yet));
return TRUE;
#ifdef FEAT_SEARCHPATH
if (spats[i].pat == NULL) // pattern was never defined
{
if (pat_use == RE_SUBST)
- emsg(_(e_nopresub));
+ emsg(_(e_no_previous_substitute_regular_expression));
else
- emsg(_(e_noprevre));
+ emsg(_(e_no_previous_regular_expression));
rc_did_emsg = TRUE;
return FAIL;
}
searchstr = spats[RE_SUBST].pat;
if (searchstr == NULL)
{
- emsg(_(e_noprevre));
+ emsg(_(e_no_previous_regular_expression));
retval = 0;
goto end_do_search;
}
if (curbuf->b_ffname == NULL)
{
- emsg(_(e_noname));
+ emsg(_(e_no_file_name));
return NULL;
}
sname = home_replace_save(NULL, curbuf->b_ffname);
if (ga_grow(&ga, 1) == FAIL)
{
ga_clear(&ga);
- ret_msg = e_outofmem;
+ ret_msg = e_out_of_memory;
goto theend;
}
LANGP_ENTRY(ga, ga.ga_len)->lp_slang = slang;
id = syn_namen2id(arg, (int)(arg_end - arg));
if (id == 0)
{
- semsg(_(e_nogroup), arg);
+ semsg(_(e_no_such_highlight_group_name_str), arg);
break;
}
else
{
id = syn_namen2id(arg, (int)(arg_end - arg));
if (id == 0)
- semsg(_(e_nogroup), arg);
+ semsg(_(e_no_such_highlight_group_name_str), arg);
else
syn_list_one(id, syncing, TRUE);
}
if (argvars[0].v_type != VAR_UNKNOWN)
{
if (argvars[0].v_type != VAR_NUMBER)
- emsg(_(e_number_exp));
+ emsg(_(e_number_expected));
else
{
timer = find_timer((int)tv_get_number(&argvars[0]));
return;
if (argvars[0].v_type != VAR_NUMBER)
- emsg(_(e_number_exp));
+ emsg(_(e_number_expected));
else
{
int paused = (int)tv_get_bool(&argvars[1]);
if (argvars[0].v_type != VAR_NUMBER)
{
- emsg(_(e_number_exp));
+ emsg(_(e_number_expected));
return;
}
timer = find_timer((int)tv_get_number(&argvars[0]));
if ((cstack->cs_rettv[idx] = alloc_tv()) != NULL)
*(typval_T *)cstack->cs_rettv[idx] = *(typval_T *)rettv;
else
- emsg(_(e_outofmem));
+ emsg(_(e_out_of_memory));
}
else
cstack->cs_rettv[idx] = NULL;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3190,
/**/
3189,
/**/
else if (dest_type == VAR_LIST
&& tv_idx->v_type != VAR_NUMBER)
{
- emsg(_(e_number_exp));
+ emsg(_(e_number_expected));
status = FAIL;
}
}
)
{
SOURCING_LNUM = iptr->isn_lnum;
- emsg(_(e_number_exp));
+ emsg(_(e_number_expected));
goto on_error;
}
#ifdef FEAT_FLOAT
{
if (VISIBLE_HEIGHT(oldwin) <= p_wmh && new_wp == NULL)
{
- emsg(_(e_noroom));
+ emsg(_(e_not_enough_room));
return FAIL;
}
need_status = STATUS_HEIGHT;
}
if (available < needed && new_wp == NULL)
{
- emsg(_(e_noroom));
+ emsg(_(e_not_enough_room));
return FAIL;
}
if (new_size == 0)
}
if (available < needed && new_wp == NULL)
{
- emsg(_(e_noroom));
+ emsg(_(e_not_enough_room));
return FAIL;
}
oldwin_height = oldwin->w_height;
--p_wmh;
if (first)
{
- emsg(_(e_noroom));
+ emsg(_(e_not_enough_room));
first = FALSE;
}
}
--p_wmw;
if (first)
{
- emsg(_(e_noroom));
+ emsg(_(e_not_enough_room));
first = FALSE;
}
}
{
if (frp == NULL)
{
- emsg(_(e_noroom));
+ emsg(_(e_not_enough_room));
p_ch = old_p_ch;
curtab->tp_ch_used = p_ch;
cmdline_row = Rows - p_ch;
{
if (fp == topframe)
{
- emsg(_(e_noroom));
+ emsg(_(e_not_enough_room));
return;
}
// In a column of frames: go to frame above. If already at