diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dict.c | 2 | ||||
-rw-r--r-- | src/errors.h | 129 | ||||
-rw-r--r-- | src/eval.c | 10 | ||||
-rw-r--r-- | src/evalfunc.c | 8 | ||||
-rw-r--r-- | src/evalvars.c | 11 | ||||
-rw-r--r-- | src/ex_cmds2.c | 2 | ||||
-rw-r--r-- | src/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/ex_eval.c | 4 | ||||
-rw-r--r-- | src/filepath.c | 2 | ||||
-rw-r--r-- | src/gui.c | 2 | ||||
-rw-r--r-- | src/gui_w32.c | 4 | ||||
-rw-r--r-- | src/hardcopy.c | 6 | ||||
-rw-r--r-- | src/help.c | 4 | ||||
-rw-r--r-- | src/highlight.c | 4 | ||||
-rw-r--r-- | src/if_python.c | 2 | ||||
-rw-r--r-- | src/list.c | 4 | ||||
-rw-r--r-- | src/misc1.c | 2 | ||||
-rw-r--r-- | src/normal.c | 6 | ||||
-rw-r--r-- | src/quickfix.c | 4 | ||||
-rw-r--r-- | src/regexp.c | 2 | ||||
-rw-r--r-- | src/regexp_bt.c | 4 | ||||
-rw-r--r-- | src/regexp_nfa.c | 5 | ||||
-rw-r--r-- | src/typval.c | 20 | ||||
-rw-r--r-- | src/userfunc.c | 33 | ||||
-rw-r--r-- | src/version.c | 2 |
25 files changed, 196 insertions, 78 deletions
diff --git a/src/dict.c b/src/dict.c index f39be72af7..64c9d5f9e1 100644 --- a/src/dict.c +++ b/src/dict.c @@ -1116,7 +1116,7 @@ dict_extend(dict_T *d1, dict_T *d2, char_u *action, char *func_name) } 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 index 543bfd7f0f..a04267ff1c 100644 --- a/src/errors.h +++ b/src/errors.h @@ -1517,7 +1517,11 @@ EXTERN char e_invalid_buffer_identifier_in_addanno[] 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_for_netbeans_buffers[] 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: <buffer=%d>: 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_dictionary[] 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 index 0fb79112dc..a99d149a0f 100644 --- 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 index bb8f83b97f..b8f8f3ed3a 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -4113,7 +4113,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) 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 *rettv) 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 index a32814e749..ce27cee33e 100644 --- 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, int *first) 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 index b118c2d74b..d2b45ab5c9 100644 --- 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 index b76de2d429..445e4eee9d 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -8273,7 +8273,7 @@ vim_mkdir_emsg(char_u *name, int prot UNUSED) { 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 index d9d6b2db54..a48f609306 100644 --- 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 index c3bd54d269..e44fcd0200 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -2056,7 +2056,7 @@ f_resolve(typval_T *argvars, typval_T *rettv) { 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; } @@ -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 index e612505dad..cba3179658 100644 --- 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 index 1ccffa5c46..33c72b7112 100644 --- 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 index 519edca2bb..f07a8fc1cc 100644 --- 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 index 253ed5bf29..484634bf93 100644 --- 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 index 7cc9aa711c..63e9068f37 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -1024,7 +1024,7 @@ DoPyCommand(const char *cmd, rangeinitializer init_range, runner run, void *arg) #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 index aadc7233d0..226d25d2ed 100644 --- a/src/list.c +++ b/src/list.c @@ -1542,7 +1542,7 @@ eval_list(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error) 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 index 2bc0de01c0..31cc63b156 100644 --- 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 index 553ed24099..df7ae561dd 100644 --- 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 index c2747b7add..f7d35f8054 100644 --- 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 index a30ff8bdc0..40b21d3f41 100644 --- 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 index 2af1f56bf6..b394342917 100644 --- 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 index 313073c920..aa752d19fc 100644 --- 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 index be3a7b8f5c..2ffc4ab08d 100644 --- a/src/typval.c +++ b/src/typval.c @@ -196,7 +196,7 @@ tv_get_bool_or_number_chk(typval_T *varp, int *denote, int want_bool) #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, int *denote, int want_bool) 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 *varp, char_u *buf, int strict) 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 index 016eedfe5d..4c9c46d51e 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -29,9 +29,6 @@ static funccall_T *current_funccal = NULL; // 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, funcexe_T *funcexe) 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 *name_arg, char_u **line_to_free) : 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 |