# HG changeset patch # User Bram Moolenaar # Date 1641332704 -3600 # Node ID b34ddbca305c67bebdbd425dee7a8184cb5b814f # Parent c3fbe78b610941c9274959b276ca5e8177eeaf4a patch 8.2.4005: error messages are spread out Commit: https://github.com/vim/vim/commit/a6f7929e62c19a6a2418a016b4c59b83eb1887ac Author: Bram Moolenaar Date: Tue Jan 4 21:30:47 2022 +0000 patch 8.2.4005: error messages are spread out Problem: Error messages are spread out. Solution: Move more error messages to errors.h. diff --git a/src/dict.c b/src/dict.c --- a/src/dict.c +++ b/src/dict.c @@ -1116,7 +1116,7 @@ dict_extend(dict_T *d1, dict_T *d2, char } else if (*action == 'e') { - semsg(_("E737: Key already exists: %s"), hi2->hi_key); + semsg(_(e_key_already_exists_str), hi2->hi_key); break; } else if (*action == 'f' && HI2DI(hi2) != di1) diff --git a/src/errors.h b/src/errors.h --- a/src/errors.h +++ b/src/errors.h @@ -1517,7 +1517,11 @@ EXTERN char e_invalid_buffer_identifier_ EXTERN char e_invalid_buffer_identifier_in_getanno[] INIT(= "E652: Invalid buffer identifier in getAnno"); #endif - +// E653 unused +EXTERN char e_missing_delimiter_after_search_pattern_str[] + INIT(= N_("E654: missing delimiter after search pattern: %s")); +EXTERN char e_too_many_symbolic_links_cycle[] + INIT(= N_("E655: Too many symbolic links (cycle?)")); #ifdef FEAT_NETBEANS_INTG // E656 EXTERN char e_netbeans_disallows_writes_of_unmodified_buffers[] @@ -1527,9 +1531,31 @@ EXTERN char e_partial_writes_disallowed_ INIT(= N_("Partial writes disallowed for NetBeans buffers")); EXTERN char e_netbeans_connection_lost_for_buffer_nr[] INIT(= N_("E658: NetBeans connection lost for buffer %d")); +#endif +#ifdef FEAT_PYTHON +EXTERN char e_cannot_invoke_python_recursively[] + INIT(= N_("E659: Cannot invoke Python recursively")); +#endif +#ifdef FEAT_NETBEANS_INTG EXTERN char e_cannot_open_netbeans_connection_info_file[] INIT(= "E660: Cannot open NetBeans connection info file"); #endif +#ifdef FEAT_MULTI_LANG +EXTERN char e_sorry_no_str_help_for_str[] + INIT(= N_("E661: Sorry, no '%s' help for %s")); +#endif +EXTERN char e_at_start_of_changelist[] + INIT(= N_("E662: At start of changelist")); +EXTERN char e_at_end_of_changelist[] + INIT(= N_("E663: At end of changelist")); +EXTERN char e_changelist_is_empty[] + INIT(= N_("E664: changelist is empty")); +#ifdef FEAT_GUI +EXTERN char e_cannot_start_gui_no_valid_font_found[] + INIT(= N_("E665: Cannot start GUI, no valid font found")); +#endif +EXTERN char e_compiler_not_supported_str[] + INIT(= N_("E666: compiler not supported: %s")); #ifdef HAVE_FSYNC EXTERN char e_fsync_failed[] INIT(= N_("E667: Fsync failed")); @@ -1538,12 +1564,38 @@ EXTERN char e_fsync_failed[] EXTERN char e_wrong_access_mode_for_netbeans_connection_info_file_str[] INIT(= N_("E668: Wrong access mode for NetBeans connection info file: \"%s\"")); #endif +EXTERN char e_unprintable_character_in_group_name[] + INIT(= N_("E669: Unprintable character in group name")); +EXTERN char e_mix_of_help_file_encodings_within_language_str[] + INIT(= N_("E670: Mix of help file encodings within a language: %s")); +#ifdef FEAT_GUI_MSWIN +EXTERN char e_cannot_find_window_title_str[] + INIT(= N_("E671: Cannot find window title \"%s\"")); +EXTERN char e_unable_to_open_window_inside_mdi_application[] + INIT(= N_("E672: Unable to open window inside MDI application")); +#endif +EXTERN char e_incompatible_multi_byte_encoding_and_character_set[] + INIT(= N_("E673: Incompatible multi-byte encoding and character set")); +EXTERN char e_printmbcharset_cannot_be_empty_with_multi_byte_encoding[] + INIT(= N_("E674: printmbcharset cannot be empty with multi-byte encoding.")); +EXTERN char e_no_default_font_specified_for_multi_byte_printing[] + INIT(= N_("E675: No default font specified for multi-byte printing.")); EXTERN char e_no_matching_autocommands_for_acwrite_buffer[] INIT(= N_("E676: No matching autocommands for acwrite buffer")); +EXTERN char e_error_writing_temp_file[] + INIT(= N_("E677: Error writing temp file")); +EXTERN char e_invalid_character_after_str_2[] + INIT(= N_("E678: Invalid character after %s%%[dxouU]")); +EXTERN char e_recursive_loop_loading_syncolor_vim[] + INIT(= N_("E679: recursive loop loading syncolor.vim")); EXTERN char e_buffer_nr_invalid_buffer_number[] INIT(= N_("E680: : invalid buffer number")); +EXTERN char e_buffer_is_not_loaded[] + INIT(= N_("E681: Buffer is not loaded")); EXTERN char e_invalid_search_pattern_or_delimiter[] INIT(= N_("E682: Invalid search pattern or delimiter")); +EXTERN char e_file_name_missing_or_invalid_pattern[] + INIT(= N_("E683: File name missing or invalid pattern")); #ifdef FEAT_EVAL EXTERN char e_list_index_out_of_range_nr[] INIT(= N_("E684: list index out of range: %ld")); @@ -1553,15 +1605,50 @@ EXTERN char e_internal_error_str[] #ifdef FEAT_EVAL EXTERN char e_argument_of_str_must_be_list[] INIT(= N_("E686: Argument of %s must be a List")); +EXTERN char e_less_targets_than_list_items[] + INIT(= N_("E687: Less targets than List items")); +EXTERN char e_more_targets_than_list_items[] + INIT(= N_("E688: More targets than List items")); +EXTERN char e_can_only_index_list_dictionary_or_blob[] + INIT(= N_("E689: Can only index a List, Dictionary or Blob")); EXTERN char e_missing_in_after_for[] INIT(= N_("E690: Missing \"in\" after :for")); +EXTERN char e_can_only_compare_list_with_list[] + INIT(= N_("E691: Can only compare List with List")); +EXTERN char e_invalid_operation_for_list[] + INIT(= N_("E692: Invalid operation for List")); // E693 unused +EXTERN char e_invalid_operation_for_funcrefs[] + INIT(= N_("E694: Invalid operation for Funcrefs")); EXTERN char e_cannot_index_a_funcref[] INIT(= N_("E695: Cannot index a Funcref")); +EXTERN char e_missing_comma_in_list_str[] + INIT(= N_("E696: Missing comma in List: %s")); EXTERN char e_missing_end_of_list_rsb_str[] INIT(= N_("E697: Missing end of List ']': %s")); - +EXTERN char e_variable_nested_too_deep_for_making_copy[] + INIT(= N_("E698: variable nested too deep for making a copy")); +EXTERN char e_too_many_arguments[] + INIT(= N_("E699: Too many arguments")); +EXTERN char e_unknown_function_str_2[] + INIT(= N_("E700: Unknown function: %s")); +EXTERN char e_invalid_type_for_len[] + INIT(= N_("E701: Invalid type for len()")); +EXTERN char e_sort_compare_function_failed[] + INIT(= N_("E702: Sort compare function failed")); +EXTERN char e_using_funcref_as_number[] + INIT(= N_("E703: Using a Funcref as a Number")); +EXTERN char e_funcref_variable_name_must_start_with_capital_str[] + INIT(= N_("E704: Funcref variable name must start with a capital: %s")); +EXTERN char e_variable_name_conflicts_with_existing_function_str[] + INIT(= N_("E705: Variable name conflicts with existing function: %s")); // E706 unused +EXTERN char e_function_name_conflicts_with_variable_str[] + INIT(= N_("E707: Function name conflicts with variable: %s")); +EXTERN char e_slice_must_come_last[] + INIT(= N_("E708: [:] must come last")); +EXTERN char e_slice_requires_list_or_blob_value[] + INIT(= N_("E709: [:] requires a List or Blob value")); EXTERN char e_list_value_has_more_items_than_targets[] INIT(= N_("E710: List value has more items than targets")); EXTERN char e_list_value_does_not_have_enough_items[] @@ -1576,6 +1663,10 @@ EXTERN char e_dictionary_required[] INIT(= N_("E715: Dictionary required")); EXTERN char e_key_not_present_in_dictionary[] INIT(= N_("E716: Key not present in Dictionary: \"%s\"")); +EXTERN char e_dictionary_entry_already_exists[] + INIT(= N_("E717: Dictionary entry already exists")); +EXTERN char e_funcref_required[] + INIT(= N_("E718: Funcref required")); EXTERN char e_cannot_slice_dictionary[] INIT(= N_("E719: Cannot slice a Dictionary")); EXTERN char e_missing_colon_in_dictionary[] @@ -1586,8 +1677,40 @@ EXTERN char e_missing_comma_in_dictionar INIT(= N_("E722: Missing comma in Dictionary: %s")); EXTERN char e_missing_dict_end[] INIT(= N_("E723: Missing end of Dictionary '}': %s")); +EXTERN char e_variable_nested_too_deep_for_displaying[] + INIT(= N_("E724: variable nested too deep for displaying")); +EXTERN char e_calling_dict_function_without_dictionary_str[] + INIT(= N_("E725: Calling dict function without Dictionary: %s")); +EXTERN char e_stride_is_zero[] + INIT(= N_("E726: Stride is zero")); +EXTERN char e_start_past_end[] + INIT(= N_("E727: Start past end")); +EXTERN char e_using_dictionary_as_number[] + INIT(= N_("E728: Using a Dictionary as a Number")); +EXTERN char e_using_funcref_as_string[] + INIT(= N_("E729: Using a Funcref as a String")); +EXTERN char e_using_list_as_string[] + INIT(= N_("E730: Using a List as a String")); +EXTERN char e_using_dictionary_as_string[] + INIT(= N_("E731: Using a Dictionary as a String")); +EXTERN char e_using_endfor_with_while[] + INIT(= N_("E732: Using :endfor with :while")); +EXTERN char e_using_endwhile_with_for[] + INIT(= N_("E733: Using :endwhile with :for")); EXTERN char e_wrong_variable_type_for_str_equal[] INIT(= N_("E734: Wrong variable type for %s=")); +EXTERN char e_can_only_compare_dictionary_with_dictionary[] + INIT(= N_("E735: Can only compare Dictionary with Dictionary")); +EXTERN char e_invalid_operation_for_dictionary[] + INIT(= N_("E736: Invalid operation for Dictionary")); +EXTERN char e_key_already_exists_str[] + INIT(= N_("E737: Key already exists: %s")); +EXTERN char e_cant_list_variables_for_str[] + INIT(= N_("E738: Can't list variables for %s")); +EXTERN char e_cannot_create_directory_str[] + INIT(= N_("E739: Cannot create directory: %s")); +EXTERN char e_too_many_arguments_for_function_str_2[] + INIT(= N_("E740: Too many arguments for function %s")); EXTERN char e_value_is_locked[] INIT(= N_("E741: Value is locked")); EXTERN char e_value_is_locked_str[] @@ -1700,6 +1823,8 @@ EXTERN char e_string_required[] EXTERN char e_buffer_cannot_be_registered[] INIT(= N_("E931: Buffer cannot be registered")); #ifdef FEAT_EVAL +EXTERN char e_closure_function_should_not_be_at_top_level[] + INIT(= N_("E932: Closure function should not be at top level: %s")); EXTERN char e_function_was_deleted_str[] INIT(= N_("E933: Function was deleted: %s")); #endif diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -958,7 +958,7 @@ get_lval( && lp->ll_tv->v_type != VAR_BLOB) { if (!quiet) - emsg(_("E689: Can only index a List, Dictionary or Blob")); + emsg(_(e_can_only_index_list_dictionary_or_blob)); return NULL; } @@ -972,7 +972,7 @@ get_lval( if (lp->ll_range) { if (!quiet) - emsg(_("E708: [:] must come last")); + emsg(_(e_slice_must_come_last)); return NULL; } @@ -1039,7 +1039,7 @@ get_lval( && rettv->vval.v_blob != NULL)) { if (!quiet) - emsg(_("E709: [:] requires a List or Blob value")); + emsg(_(e_slice_requires_list_or_blob_value)); clear_tv(&var1); return NULL; } @@ -5010,7 +5010,7 @@ echo_string_core( // flooding the user with errors. And stop iterating over lists // and dicts. did_echo_string_emsg = TRUE; - emsg(_("E724: variable nested too deep for displaying")); + emsg(_(e_variable_nested_too_deep_for_displaying)); } *tofree = NULL; return (char_u *)"{E724}"; @@ -6020,7 +6020,7 @@ item_copy( if (recurse >= DICT_MAXNEST) { - emsg(_("E698: variable nested too deep for making a copy")); + emsg(_(e_variable_nested_too_deep_for_making_copy)); return FAIL; } ++recurse; diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -4113,7 +4113,7 @@ common_function(typval_T *argvars, typva else if (trans_name != NULL && (is_funcref ? find_func(trans_name, is_global, NULL) == NULL : !translated_function_exists(trans_name, is_global))) - semsg(_("E700: Unknown function: %s"), s); + semsg(_(e_unknown_function_str_2), s); else { int dict_idx = 0; @@ -6779,7 +6779,7 @@ f_len(typval_T *argvars, typval_T *rettv case VAR_JOB: case VAR_CHANNEL: case VAR_INSTR: - emsg(_("E701: Invalid type for len()")); + emsg(_(e_invalid_type_for_len)); break; } } @@ -7836,9 +7836,9 @@ f_range(typval_T *argvars, typval_T *ret if (error) return; // type error; errmsg already given if (stride == 0) - emsg(_("E726: Stride is zero")); + emsg(_(e_stride_is_zero)); else if (stride > 0 ? end + 1 < start : end - 1 > start) - emsg(_("E727: Start past end")); + emsg(_(e_start_past_end)); else if (rettv_list_alloc(rettv) == OK) { list_T *list = rettv->vval.v_list; diff --git a/src/evalvars.c b/src/evalvars.c --- a/src/evalvars.c +++ b/src/evalvars.c @@ -964,12 +964,12 @@ ex_let_vars( i = list_len(l); if (semicolon == 0 && var_count < i) { - emsg(_("E687: Less targets than List items")); + emsg(_(e_less_targets_than_list_items)); return FAIL; } if (var_count - semicolon > i) { - emsg(_("E688: More targets than List items")); + emsg(_(e_more_targets_than_list_items)); return FAIL; } @@ -1256,7 +1256,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, case 's': list_script_vars(first); break; case 'l': list_func_vars(first); break; default: - semsg(_("E738: Can't list variables for %s"), name); + semsg(_(e_cant_list_variables_for_str), name); } } else @@ -3691,8 +3691,7 @@ var_wrong_func_name( && !ASCII_ISUPPER((name[0] != NUL && name[1] == ':') ? name[2] : name[0])) { - semsg(_("E704: Funcref variable name must start with a capital: %s"), - name); + semsg(_(e_funcref_variable_name_must_start_with_capital_str), name); return TRUE; } // Don't allow hiding a function. When "v" is not NULL we might be @@ -3700,7 +3699,7 @@ var_wrong_func_name( // below. if (new_var && function_exists(name, FALSE)) { - semsg(_("E705: Variable name conflicts with existing function: %s"), + semsg(_(e_variable_name_conflicts_with_existing_function_str), name); return TRUE; } diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -761,7 +761,7 @@ ex_compiler(exarg_T *eap) sprintf((char *)buf, "compiler/%s.vim", eap->arg); if (source_runtime(buf, DIP_ALL) == FAIL) - semsg(_("E666: compiler not supported: %s"), eap->arg); + semsg(_(e_compiler_not_supported_str), eap->arg); vim_free(buf); do_cmdline_cmd((char_u *)":delcommand CompilerSet"); diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -8273,7 +8273,7 @@ vim_mkdir_emsg(char_u *name, int prot UN { if (vim_mkdir(name, prot) != 0) { - semsg(_("E739: Cannot create directory: %s"), name); + semsg(_(e_cannot_create_directory_str), name); return FAIL; } return OK; diff --git a/src/ex_eval.c b/src/ex_eval.c --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -1406,9 +1406,9 @@ ex_endwhile(exarg_T *eap) // If we are in a ":while" or ":for" but used the wrong endloop // command, do not rewind to the next enclosing ":for"/":while". if (fl & CSF_WHILE) - eap->errmsg = _("E732: Using :endfor with :while"); + eap->errmsg = _(e_using_endfor_with_while); else if (fl & CSF_FOR) - eap->errmsg = _("E733: Using :endwhile with :for"); + eap->errmsg = _(e_using_endwhile_with_for); } if (!(fl & (CSF_WHILE | CSF_FOR))) { diff --git a/src/filepath.c b/src/filepath.c --- a/src/filepath.c +++ b/src/filepath.c @@ -2056,7 +2056,7 @@ f_resolve(typval_T *argvars, typval_T *r { vim_free(p); vim_free(remain); - emsg(_("E655: Too many symbolic links (cycle?)")); + emsg(_(e_too_many_symbolic_links_cycle)); rettv->vval.v_string = NULL; goto fail; } diff --git a/src/gui.c b/src/gui.c --- a/src/gui.c +++ b/src/gui.c @@ -682,7 +682,7 @@ gui_init(void) gui_init_font(*p_guifont == NUL ? hl_get_font_name() : p_guifont, FALSE) == FAIL) { - emsg(_("E665: Cannot start GUI, no valid font found")); + emsg(_(e_cannot_start_gui_no_valid_font_found)); goto error2; } if (gui_get_wide_font() == FAIL) diff --git a/src/gui_w32.c b/src/gui_w32.c --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -4965,7 +4965,7 @@ gui_mch_set_parent(char *title) EnumWindows(FindWindowTitle, (LPARAM)title); if (vim_parent_hwnd == NULL) { - semsg(_("E671: Cannot find window title \"%s\""), title); + semsg(_(e_cannot_find_window_title_str), title); mch_exit(2); } } @@ -5303,7 +5303,7 @@ gui_mch_init(void) #endif if (s_hwnd == NULL) { - emsg(_("E672: Unable to open window inside MDI application")); + emsg(_(e_unable_to_open_window_inside_mdi_application)); mch_exit(2); } } diff --git a/src/hardcopy.c b/src/hardcopy.c --- a/src/hardcopy.c +++ b/src/hardcopy.c @@ -2417,7 +2417,7 @@ mch_print_init( // Check encoding and character set are compatible if ((p_mbenc->needs_charset & p_mbchar->has_charset) == 0) { - emsg(_("E673: Incompatible multi-byte encoding and character set.")); + emsg(_(e_incompatible_multi_byte_encoding_and_character_set)); return FALSE; } @@ -2434,7 +2434,7 @@ mch_print_init( // Add custom CMap character set name if (*p_pmcs == NUL) { - emsg(_("E674: printmbcharset cannot be empty with multi-byte encoding.")); + emsg(_(e_printmbcharset_cannot_be_empty_with_multi_byte_encoding)); return FALSE; } vim_strncpy((char_u *)prt_cmap, p_pmcs, sizeof(prt_cmap) - 3); @@ -2452,7 +2452,7 @@ mch_print_init( if (!mbfont_opts[OPT_MBFONT_REGULAR].present) { - emsg(_("E675: No default font specified for multi-byte printing.")); + emsg(_(e_no_default_font_specified_for_multi_byte_printing)); return FALSE; } diff --git a/src/help.c b/src/help.c --- a/src/help.c +++ b/src/help.c @@ -104,7 +104,7 @@ ex_help(exarg_T *eap) { #ifdef FEAT_MULTI_LANG if (lang != NULL) - semsg(_("E661: Sorry, no '%s' help for %s"), lang, arg); + semsg(_(e_sorry_no_str_help_for_str), lang, arg); else #endif semsg(_(e_sorry_no_help_for_str), arg); @@ -1058,7 +1058,7 @@ helptags_one( utf8 = this_utf8; else if (utf8 != this_utf8) { - semsg(_("E670: Mix of help file encodings within a language: %s"), files[fi]); + semsg(_(e_mix_of_help_file_encodings_within_language_str), files[fi]); mix = !got_int; got_int = TRUE; } diff --git a/src/highlight.c b/src/highlight.c --- a/src/highlight.c +++ b/src/highlight.c @@ -447,7 +447,7 @@ init_highlight( static int recursive = 0; if (recursive >= 5) - emsg(_("E679: recursive loop loading syncolor.vim")); + emsg(_(e_recursive_loop_loading_syncolor_vim)); else { ++recursive; @@ -3443,7 +3443,7 @@ syn_add_group(char_u *name) { if (!vim_isprintc(*p)) { - emsg(_("E669: Unprintable character in group name")); + emsg(_(e_unprintable_character_in_group_name)); vim_free(name); return 0; } diff --git a/src/if_python.c b/src/if_python.c --- a/src/if_python.c +++ b/src/if_python.c @@ -1024,7 +1024,7 @@ DoPyCommand(const char *cmd, rangeinitia #ifndef PY_CAN_RECURSE if (recursive) { - emsg(_("E659: Cannot invoke Python recursively")); + emsg(_(e_cannot_invoke_python_recursively)); return; } ++recursive; diff --git a/src/list.c b/src/list.c --- a/src/list.c +++ b/src/list.c @@ -1542,7 +1542,7 @@ eval_list(char_u **arg, typval_T *rettv, semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg); else - semsg(_("E696: Missing comma in List: %s"), *arg); + semsg(_(e_missing_comma_in_list_str), *arg); } goto failret; } @@ -2002,7 +2002,7 @@ do_sort(list_T *l, sortinfo_T *info) || info->item_compare_partial != NULL) && item_compare2((void *)&ptrs[0], (void *)&ptrs[1]) == ITEM_COMPARE_FAIL) - emsg(_("E702: Sort compare function failed")); + emsg(_(e_sort_compare_function_failed)); else { // Sort the array with item pointers. diff --git a/src/misc1.c b/src/misc1.c --- a/src/misc1.c +++ b/src/misc1.c @@ -2447,7 +2447,7 @@ get_cmd_output_as_rettv( err = TRUE; if (err) { - emsg(_("E677: Error writing temp file")); + emsg(_(e_error_writing_temp_file)); goto errret; } } diff --git a/src/normal.c b/src/normal.c --- a/src/normal.c +++ b/src/normal.c @@ -5627,11 +5627,11 @@ nv_pcmark(cmdarg_T *cap) else if (cap->cmdchar == 'g') { if (curbuf->b_changelistlen == 0) - emsg(_("E664: changelist is empty")); + emsg(_(e_changelist_is_empty)); else if (cap->count1 < 0) - emsg(_("E662: At start of changelist")); + emsg(_(e_at_start_of_changelist)); else - emsg(_("E663: At end of changelist")); + emsg(_(e_at_end_of_changelist)); } else clearopbeep(cap->oap); diff --git a/src/quickfix.c b/src/quickfix.c --- a/src/quickfix.c +++ b/src/quickfix.c @@ -6116,7 +6116,7 @@ vgr_process_args( p = skipwhite(p); if (*p == NUL) { - emsg(_("E683: File name missing or invalid pattern")); + emsg(_(e_file_name_missing_or_invalid_pattern)); return FAIL; } @@ -7785,7 +7785,7 @@ cbuffer_process_args( if (buf->b_ml.ml_mfp == NULL) { - emsg(_("E681: Buffer is not loaded")); + emsg(_(e_buffer_is_not_loaded)); return FAIL; } diff --git a/src/regexp.c b/src/regexp.c --- a/src/regexp.c +++ b/src/regexp.c @@ -552,7 +552,7 @@ skip_regexp_err( if (*p != delim) { - semsg(_("E654: missing delimiter after search pattern: %s"), startp); + semsg(_(e_missing_delimiter_after_search_pattern_str), startp); return NULL; } return p; diff --git a/src/regexp_bt.c b/src/regexp_bt.c --- a/src/regexp_bt.c +++ b/src/regexp_bt.c @@ -1612,8 +1612,8 @@ regatom(int *flagp) if (i < 0 || i > INT_MAX) EMSG2_RET_NULL( - _("E678: Invalid character after %s%%[dxouU]"), - reg_magic == MAGIC_ALL); + _(e_invalid_character_after_str_2), + reg_magic == MAGIC_ALL); if (use_multibytecode(i)) ret = regnode(MULTIBYTECODE); else diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -1638,9 +1638,8 @@ nfa_regatom(void) } if (nr < 0 || nr > INT_MAX) - EMSG2_RET_FAIL( - _("E678: Invalid character after %s%%[dxouU]"), - reg_magic == MAGIC_ALL); + EMSG2_RET_FAIL(_(e_invalid_character_after_str_2), + reg_magic == MAGIC_ALL); // A NUL is stored in the text as NL // TODO: what if a composing character follows? EMIT(nr == 0 ? 0x0a : nr); diff --git a/src/typval.c b/src/typval.c --- a/src/typval.c +++ b/src/typval.c @@ -196,7 +196,7 @@ tv_get_bool_or_number_chk(typval_T *varp #endif case VAR_FUNC: case VAR_PARTIAL: - emsg(_("E703: Using a Funcref as a Number")); + emsg(_(e_using_funcref_as_number)); break; case VAR_STRING: if (in_vim9script()) @@ -212,7 +212,7 @@ tv_get_bool_or_number_chk(typval_T *varp emsg(_("E745: Using a List as a Number")); break; case VAR_DICT: - emsg(_("E728: Using a Dictionary as a Number")); + emsg(_(e_using_dictionary_as_number)); break; case VAR_BOOL: case VAR_SPECIAL: @@ -927,13 +927,13 @@ tv_get_string_buf_chk_strict(typval_T *v return buf; case VAR_FUNC: case VAR_PARTIAL: - emsg(_("E729: Using a Funcref as a String")); + emsg(_(e_using_funcref_as_string)); break; case VAR_LIST: - emsg(_("E730: Using a List as a String")); + emsg(_(e_using_list_as_string)); break; case VAR_DICT: - emsg(_("E731: Using a Dictionary as a String")); + emsg(_(e_using_dictionary_as_string)); break; case VAR_FLOAT: #ifdef FEAT_FLOAT @@ -1345,9 +1345,9 @@ typval_compare_list( || (type != EXPR_EQUAL && type != EXPR_NEQUAL)) { if (tv1->v_type != tv2->v_type) - emsg(_("E691: Can only compare List with List")); + emsg(_(e_can_only_compare_list_with_list)); else - emsg(_("E692: Invalid operation for List")); + emsg(_(e_invalid_operation_for_list)); return FAIL; } else @@ -1427,9 +1427,9 @@ typval_compare_dict( || (type != EXPR_EQUAL && type != EXPR_NEQUAL)) { if (tv1->v_type != tv2->v_type) - emsg(_("E735: Can only compare Dictionary with Dictionary")); + emsg(_(e_can_only_compare_dictionary_with_dictionary)); else - emsg(_("E736: Invalid operation for Dictionary")); + emsg(_(e_invalid_operation_for_dictionary)); return FAIL; } else @@ -1460,7 +1460,7 @@ typval_compare_func( if (type != EXPR_EQUAL && type != EXPR_NEQUAL && type != EXPR_IS && type != EXPR_ISNOT) { - emsg(_("E694: Invalid operation for Funcrefs")); + emsg(_(e_invalid_operation_for_funcrefs)); return FAIL; } if ((tv1->v_type == VAR_PARTIAL && tv1->vval.v_partial == NULL) diff --git a/src/userfunc.c b/src/userfunc.c --- a/src/userfunc.c +++ b/src/userfunc.c @@ -29,9 +29,6 @@ static funccall_T *current_funccal = NUL // item in it is still being used. static funccall_T *previous_funccal = NULL; -static char *e_funcdict = N_("E717: Dictionary entry already exists"); -static char *e_funcref = N_("E718: Funcref required"); - static void funccal_unref(funccall_T *fc, ufunc_T *fp, int force); static void func_clear(ufunc_T *fp, int force); static int func_free(ufunc_T *fp, int force); @@ -1802,7 +1799,7 @@ get_func_tv( else if (!aborting()) { if (argcount == MAX_FUNC_ARGS) - emsg_funcname(N_("E740: Too many arguments for function %s"), name); + emsg_funcname(e_too_many_arguments_for_function_str_2, name); else emsg_funcname(e_invalid_arguments_for_function_str, name); } @@ -3156,7 +3153,7 @@ func_call( { if (argc == MAX_FUNC_ARGS - (partial == NULL ? 0 : partial->pt_argc)) { - emsg(_("E699: Too many arguments")); + emsg(_(e_too_many_arguments)); break; } // Make a copy of each argument. This is needed to be able to set @@ -3274,21 +3271,18 @@ user_func_error(int error, char_u *name, emsg_funcname(e_function_was_deleted_str, name); break; case FCERR_TOOMANY: - emsg_funcname((char *)e_too_many_arguments_for_function_str, - name); + emsg_funcname(e_too_many_arguments_for_function_str, name); break; case FCERR_TOOFEW: - emsg_funcname((char *)e_not_enough_arguments_for_function_str, - name); + emsg_funcname(e_not_enough_arguments_for_function_str, name); break; case FCERR_SCRIPT: emsg_funcname( e_using_sid_not_in_script_context_str, name); break; case FCERR_DICT: - emsg_funcname( - N_("E725: Calling dict function without Dictionary: %s"), - name); + emsg_funcname(e_calling_dict_function_without_dictionary_str, + name); break; } } @@ -3725,7 +3719,7 @@ trans_function_name( { if (!skip && !(flags & TFN_QUIET) && (fdp == NULL || lv.ll_dict == NULL || fdp->fd_newkey == NULL)) - emsg(_(e_funcref)); + emsg(_(e_funcref_required)); else *pp = end; name = NULL; @@ -4258,7 +4252,7 @@ define_function(exarg_T *eap, char_u *na : eval_isnamec(name_base[i])); ++i) ; if (name_base[i] != NUL) - emsg_funcname((char *)e_invalid_argument_str, arg); + emsg_funcname(e_invalid_argument_str, arg); // In Vim9 script a function cannot have the same name as a // variable. @@ -4344,7 +4338,7 @@ define_function(exarg_T *eap, char_u *na p += 7; if (current_funccal == NULL) { - emsg_funcname(N_("E932: Closure function should not be at top level: %s"), + emsg_funcname(e_closure_function_should_not_be_at_top_level, name == NULL ? (char_u *)"" : name); goto erret; } @@ -4378,7 +4372,7 @@ define_function(exarg_T *eap, char_u *na if (!eap->skip && !eap->forceit) { if (fudi.fd_dict != NULL && fudi.fd_newkey == NULL) - emsg(_(e_funcdict)); + emsg(_(e_dictionary_entry_already_exists)); else if (name != NULL && find_func(name, is_global, NULL) != NULL) emsg_funcname(e_function_str_already_exists_add_bang_to_replace, name); } @@ -4409,8 +4403,7 @@ define_function(exarg_T *eap, char_u *na v = find_var(name, &ht, TRUE); if (v != NULL && v->di_tv.v_type == VAR_FUNC) { - emsg_funcname(N_("E707: Function name conflicts with variable: %s"), - name); + emsg_funcname(e_function_name_conflicts_with_variable_str, name); goto erret; } @@ -4481,7 +4474,7 @@ define_function(exarg_T *eap, char_u *na fp = NULL; if (fudi.fd_newkey == NULL && !eap->forceit) { - emsg(_(e_funcdict)); + emsg(_(e_dictionary_entry_already_exists)); goto erret; } if (fudi.fd_di == NULL) @@ -4893,7 +4886,7 @@ ex_delfunction(exarg_T *eap) if (name == NULL) { if (fudi.fd_dict != NULL && !eap->skip) - emsg(_(e_funcref)); + emsg(_(e_funcref_required)); return; } if (!ends_excmd(*skipwhite(p))) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4005, +/**/ 4004, /**/ 4003,