diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-05 20:24:39 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-05 20:24:39 +0000 |
commit | d82a47dd0493ee976aa3f15ecdc9aea7da6ad5bf (patch) | |
tree | 604109254c7057942fce5c1af26fdd1bc36c066f | |
parent | bb8cac56d9c398a2b546d9c81c15e8c3d8fd811e (diff) |
patch 8.2.4012: error messages are spread outv8.2.4012
Problem: Error messages are spread out.
Solution: Move the last error messages to errors.h.
-rw-r--r-- | src/channel.c | 29 | ||||
-rw-r--r-- | src/clientserver.c | 4 | ||||
-rw-r--r-- | src/diff.c | 4 | ||||
-rw-r--r-- | src/errors.h | 254 | ||||
-rw-r--r-- | src/evalfunc.c | 13 | ||||
-rw-r--r-- | src/evalvars.c | 16 | ||||
-rw-r--r-- | src/ex_cmds2.c | 3 | ||||
-rw-r--r-- | src/ex_docmd.c | 8 | ||||
-rw-r--r-- | src/gui_w32.c | 2 | ||||
-rw-r--r-- | src/help.c | 2 | ||||
-rw-r--r-- | src/if_mzsch.c | 2 | ||||
-rw-r--r-- | src/if_py_both.h | 8 | ||||
-rw-r--r-- | src/if_python.c | 2 | ||||
-rw-r--r-- | src/job.c | 8 | ||||
-rw-r--r-- | src/json.c | 3 | ||||
-rw-r--r-- | src/list.c | 10 | ||||
-rw-r--r-- | src/option.c | 6 | ||||
-rw-r--r-- | src/optionstr.c | 4 | ||||
-rw-r--r-- | src/quickfix.c | 10 | ||||
-rw-r--r-- | src/regexp.c | 2 | ||||
-rw-r--r-- | src/regexp_nfa.c | 24 | ||||
-rw-r--r-- | src/register.c | 3 | ||||
-rw-r--r-- | src/scriptfile.c | 4 | ||||
-rw-r--r-- | src/sign.c | 4 | ||||
-rw-r--r-- | src/syntax.c | 4 | ||||
-rw-r--r-- | src/tag.c | 15 | ||||
-rw-r--r-- | src/terminal.c | 10 | ||||
-rw-r--r-- | src/textprop.c | 16 | ||||
-rw-r--r-- | src/typval.c | 28 | ||||
-rw-r--r-- | src/undo.c | 2 | ||||
-rw-r--r-- | src/userfunc.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 2 | ||||
-rw-r--r-- | src/viminfo.c | 5 |
34 files changed, 357 insertions, 156 deletions
diff --git a/src/channel.c b/src/channel.c index 3dea7803a1..4ab05499a5 100644 --- a/src/channel.c +++ b/src/channel.c @@ -707,8 +707,6 @@ channel_gui_unregister(channel_T *channel) #endif // FEAT_GUI -static char *e_cannot_connect = N_("E902: Cannot connect to port"); - /* * For Unix we need to call connect() again after connect() failed. * On Win32 one time is sufficient. @@ -737,7 +735,7 @@ channel_connect( if (sd == -1) { ch_error(channel, "in socket() in channel_connect()."); - PERROR(_("E898: socket() in channel_connect()")); + PERROR(_(e_socket_in_channel_connect)); return -1; } @@ -778,7 +776,7 @@ channel_connect( { ch_error(channel, "channel_connect: Connect failed with errno %d", errno); - PERROR(_(e_cannot_connect)); + PERROR(_(e_cannot_connect_to_port)); sock_close(sd); return -1; } @@ -824,7 +822,7 @@ channel_connect( SOCK_ERRNO; ch_error(channel, "channel_connect: Connect failed with errno %d", errno); - PERROR(_(e_cannot_connect)); + PERROR(_(e_cannot_connect_to_port)); sock_close(sd); return -1; } @@ -863,7 +861,7 @@ channel_connect( ch_error(channel, "channel_connect: Connect failed with errno %d", so_error); - PERROR(_(e_cannot_connect)); + PERROR(_(e_cannot_connect_to_port)); sock_close(sd); return -1; } @@ -982,8 +980,7 @@ channel_open( if ((err = getaddrinfo(hostname, NULL, &hints, &res)) != 0) { ch_error(channel, "in getaddrinfo() in channel_open()"); - semsg(_("E901: getaddrinfo() in channel_open(): %s"), - gai_strerror(err)); + semsg(_(e_getaddrinfo_in_channel_open_str), gai_strerror(err)); channel_free(channel); return NULL; } @@ -1047,7 +1044,7 @@ channel_open( if ((host = gethostbyname(hostname)) == NULL) { ch_error(channel, "in gethostbyname() in channel_open()"); - PERROR(_("E901: gethostbyname() in channel_open()")); + PERROR(_(e_gethostbyname_in_channel_open)); channel_free(channel); return NULL; } @@ -2480,7 +2477,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) { ch_error(channel, "received command with non-string argument"); if (p_verbose > 2) - emsg(_("E903: received command with non-string argument")); + emsg(_(e_received_command_with_non_string_argument)); return; } arg = argv[1].vval.v_string; @@ -2537,13 +2534,13 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) { ch_error(channel, "last argument for expr/call must be a number"); if (p_verbose > 2) - emsg(_("E904: last argument for expr/call must be a number")); + emsg(_(e_last_argument_for_expr_call_must_be_number)); } else if (is_call && argv[2].v_type != VAR_LIST) { ch_error(channel, "third argument for call must be a list"); if (p_verbose > 2) - emsg(_("E904: third argument for call must be a list")); + emsg(_(e_third_argument_for_call_must_be_list)); } else { @@ -2600,7 +2597,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) else if (p_verbose > 2) { ch_error(channel, "Received unknown command: %s", (char *)cmd); - semsg(_("E905: received unknown command: %s"), cmd); + semsg(_(e_received_unknown_command_str), cmd); } } @@ -3843,7 +3840,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part) if (check_open && (channel == NULL || (!channel_is_open(channel) && !(reading && has_readahead)))) { - emsg(_("E906: not an open channel")); + emsg(_(e_not_an_open_channel)); return NULL; } return channel; @@ -4245,7 +4242,7 @@ send_common( { if (eval) { - semsg(_("E917: Cannot use a callback with %s()"), fun); + semsg(_(e_cannot_use_callback_with_str), fun); return NULL; } channel_set_req_callback(channel, *part_read, &opt->jo_callback, id); @@ -4290,7 +4287,7 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval) ch_mode = channel_get_mode(channel, part_send); if (ch_mode == MODE_RAW || ch_mode == MODE_NL) { - emsg(_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel")); + emsg(_(e_cannot_use_evalexpr_sendexpr_with_raw_or_nl_channel)); return; } diff --git a/src/clientserver.c b/src/clientserver.c index ca6a4eb668..0f178d0881 100644 --- a/src/clientserver.c +++ b/src/clientserver.c @@ -972,7 +972,7 @@ f_remote_startserver(typval_T *argvars UNUSED, typval_T *rettv UNUSED) if (server == NULL) return; // type error; errmsg already given if (serverName != NULL) - emsg(_("E941: already started a server")); + emsg(_(e_already_started_server)); else { # ifdef FEAT_X11 @@ -983,7 +983,7 @@ f_remote_startserver(typval_T *argvars UNUSED, typval_T *rettv UNUSED) # endif } #else - emsg(_("E942: +clientserver feature not available")); + emsg(_(e_clientserver_feature_not_available)); #endif } diff --git a/src/diff.c b/src/diff.c index 5a98196126..4136d99b44 100644 --- a/src/diff.c +++ b/src/diff.c @@ -1139,7 +1139,7 @@ diff_file_internal(diffio_T *diffio) &diffio->dio_new.din_mmfile, ¶m, &emit_cfg, &emit_cb) < 0) { - emsg(_("E960: Problem creating the internal diff")); + emsg(_(e_problem_creating_internal_diff)); return FAIL; } return OK; @@ -1733,7 +1733,7 @@ diff_read( } else { - emsg(_("E959: Invalid diff format.")); + emsg(_(e_invalid_diff_format)); break; } } diff --git a/src/errors.h b/src/errors.h index 7f2d8c7f3d..ea0b77e4ff 100644 --- a/src/errors.h +++ b/src/errors.h @@ -395,6 +395,8 @@ 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_address_type_value_str[] + INIT(= N_("E180: Invalid address type value: %s")); EXTERN char e_invalid_attribute_str[] INIT(= N_("E181: Invalid attribute: %s")); EXTERN char e_invalid_command_name[] @@ -2024,41 +2026,161 @@ EXTERN char e_nfa_regexp_end_encountered_prematurely[] INIT(= N_("E865: (NFA) Regexp end encountered prematurely")); EXTERN char e_nfa_regexp_misplaced_chr[] INIT(= N_("E866: (NFA regexp) Misplaced %c")); -EXTERN char e_nfa_unknown_operator_z_chr[] - INIT(= N_("E867: (NFA) Unknown operator '\\z%c'")); -EXTERN char e_nfa_unknown_operator_percent_chr[] - INIT(= N_("E867: (NFA) Unknown operator '\\%%%c'")); +EXTERN char e_nfa_regexp_unknown_operator_z_chr[] + INIT(= N_("E867: (NFA regexp) Unknown operator '\\z%c'")); +EXTERN char e_nfa_regexp_unknown_operator_percent_chr[] + INIT(= N_("E867: (NFA regexp) Unknown operator '\\%%%c'")); EXTERN char e_error_building_nfa_with_equivalence_class[] INIT(= N_("E868: Error building NFA with equivalence class!")); -EXTERN char e_nfa_unknown_operator_at_chr[] - INIT(= N_("E869: (NFA) Unknown operator '\\@%c'")); - +EXTERN char e_nfa_regexp_unknown_operator_at_chr[] + INIT(= N_("E869: (NFA regexp) Unknown operator '\\@%c'")); +EXTERN char e_nfa_regexp_error_reading_repetition_limits[] + INIT(= N_("E870: (NFA regexp) Error reading repetition limits")); +EXTERN char e_nfa_regexp_cant_have_multi_follow_multi[] + INIT(= N_("E871: (NFA regexp) Can't have a multi follow a multi")); +EXTERN char e_nfa_regexp_too_many_parens[] + INIT(= N_("E872: (NFA regexp) Too many '('")); +EXTERN char e_nfa_regexp_proper_termination_error[] + INIT(= N_("E873: (NFA regexp) proper termination error")); +EXTERN char e_nfa_regexp_could_not_pop_stack[] + INIT(= N_("E874: (NFA regexp) Could not pop the stack!")); +EXTERN char e_nfa_regexp_while_converting_from_postfix_to_nfa_too_many_stats_left_on_stack[] + INIT(= N_("E875: (NFA regexp) (While converting from postfix to NFA), too many states left on stack")); +EXTERN char e_nfa_regexp_not_enough_space_to_store_whole_nfa[] + INIT(= N_("E876: (NFA regexp) Not enough space to store the whole NFA")); EXTERN char e_nfa_regexp_invalid_character_class_nr[] INIT(= N_("E877: (NFA regexp) Invalid character class: %d")); - +EXTERN char e_nfa_regexp_could_not_allocate_memory_for_branch_traversal[] + INIT(= N_("E878: (NFA regexp) Could not allocate memory for branch traversal!")); +EXTERN char e_nfa_regexp_too_many_z[] + INIT(= N_("E879: (NFA regexp) Too many \\z(")); +#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) +EXTERN char e_cant_handle_systemexit_of_python_exception_in_vim[] + INIT(= N_("E880: Can't handle SystemExit of python exception in vim")); +#endif +EXTERN char e_line_count_changed_unexpectedly[] + INIT(= N_("E881: Line count changed unexpectedly")); +EXTERN char e_uniq_compare_function_failed[] + INIT(= N_("E882: Uniq compare function failed")); +EXTERN char e_search_pattern_and_expression_register_may_not_contain_two_or_more_lines[] + INIT(= N_("E883: search pattern and expression register may not contain two or more lines")); +EXTERN char e_function_name_cannot_contain_colon_str[] + INIT(= N_("E884: Function name cannot contain a colon: %s")); +EXTERN char e_not_possible_to_change_sign_str[] + INIT(= N_("E885: Not possible to change sign %s")); +EXTERN char e_cant_rename_viminfo_file_to_str[] + INIT(= N_("E886: Can't rename viminfo file to %s!")); +EXTERN char e_sorry_this_command_is_disabled_python_side_module_could_not_be_loaded[] + INIT(= N_("E887: Sorry, this command is disabled, the Python's site module could not be loaded.")); +EXTERN char e_nfa_regexp_cannot_repeat_str[] + INIT(= N_("E888: (NFA regexp) cannot repeat %s")); #ifdef FEAT_PROP_POPUP EXTERN char e_number_required[] INIT(= N_("E889: Number required")); #endif +EXTERN char e_trailing_char_after_rsb_str_str[] + INIT(= N_("E890: trailing char after ']': %s]%s")); +#ifdef FEAT_FLOAT +EXTERN char e_using_funcref_as_float[] + INIT(= N_("E891: Using a Funcref as a Float")); +EXTERN char e_using_string_as_float[] + INIT(= N_("E892: Using a String as a Float")); +EXTERN char e_using_list_as_float[] + INIT(= N_("E893: Using a List as a Float")); +EXTERN char e_using_dictionary_as_float[] + INIT(= N_("E894: Using a Dictionary as a Float")); +#endif +#ifdef FEAT_MZSCHEME +EXTERN char e_sorry_this_command_is_disabled_the_mzscheme_racket_base_module_could_not_be_loaded[] + INIT(= N_("E895: Sorry, this command is disabled, the MzScheme's racket/base module could not be loaded.")); +#endif #ifdef FEAT_EVAL EXTERN char e_argument_of_str_must_be_list_dictionary_or_blob[] INIT(= N_("E896: Argument of %s must be a List, Dictionary or Blob")); EXTERN char e_list_or_blob_required[] INIT(= N_("E897: List or Blob required")); #endif - +EXTERN char e_socket_in_channel_connect[] + INIT(= N_("E898: socket() in channel_connect()")); +EXTERN char e_argument_of_str_must_be_list_or_blob[] + INIT(= N_("E899: Argument of %s must be a List or Blob")); +EXTERN char e_maxdepth_must_be_non_negative_number[] + INIT(= N_("E900: maxdepth must be non-negative number")); +#ifdef FEAT_JOB_CHANNEL +EXTERN char e_getaddrinfo_in_channel_open_str[] + INIT(= N_("E901: getaddrinfo() in channel_open(): %s")); +EXTERN char e_gethostbyname_in_channel_open[] + INIT(= N_("E901: gethostbyname() in channel_open()")); +EXTERN char e_cannot_connect_to_port[] + INIT(= N_("E902: Cannot connect to port")); +EXTERN char e_received_command_with_non_string_argument[] + INIT(= N_("E903: received command with non-string argument")); +EXTERN char e_last_argument_for_expr_call_must_be_number[] + INIT(= N_("E904: last argument for expr/call must be a number")); +EXTERN char e_third_argument_for_call_must_be_list[] + INIT(= N_("E904: third argument for call must be a list")); +EXTERN char e_received_unknown_command_str[] + INIT(= N_("E905: received unknown command: %s")); +EXTERN char e_not_an_open_channel[] + INIT(= N_("E906: not an open channel")); +#endif +#ifdef FEAT_FLOAT +EXTERN char e_using_special_value_as_float[] + INIT(= N_("E907: Using a special value as a Float")); +#endif #ifdef FEAT_EVAL EXTERN char e_using_invalid_value_as_string_str[] INIT(= N_("E908: using an invalid value as a String: %s")); EXTERN char e_cannot_index_special_variable[] INIT(= N_("E909: Cannot index a special variable")); #endif +#ifdef FEAT_JOB_CHANNEL +EXTERN char e_using_job_as_number[] + INIT(= N_("E910: Using a Job as a Number")); +EXTERN char e_using_job_as_float[] + INIT(= N_("E911: Using a Job as a Float")); +EXTERN char e_cannot_use_evalexpr_sendexpr_with_raw_or_nl_channel[] + INIT(= N_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel")); +EXTERN char e_using_channel_as_number[] + INIT(= N_("E913: Using a Channel as a Number")); +EXTERN char e_using_channel_as_float[] + INIT(= N_("E914: Using a Channel as a Float")); +#endif +EXTERN char e_in_io_buffer_requires_in_buf_or_in_name_to_be_set[] + INIT(= N_("E915: in_io buffer requires in_buf or in_name to be set")); + +EXTERN char e_not_valid_job[] + INIT(= N_("E916: not a valid job")); +EXTERN char e_cannot_use_callback_with_str[] + INIT(= N_("E917: Cannot use a callback with %s()")); +EXTERN char e_buffer_must_be_loaded_str[] + INIT(= N_("E918: buffer must be loaded: %s")); EXTERN char e_directory_not_found_in_str_str[] INIT(= N_("E919: Directory not found in '%s': \"%s\"")); +EXTERN char e_io_file_requires_name_to_be_set[] + INIT(= N_("E920: _io file requires _name to be set")); +EXTERN char e_invalid_callback_argument[] + INIT(= N_("E921: Invalid callback argument")); +EXTERN char e_expected_dict[] + INIT(= N_("E922: expected a dict")); +EXTERN char e_second_argument_of_function_must_be_list_or_dict[] + INIT(= N_("E923: Second argument of function() must be a list or a dict")); +EXTERN char e_current_window_was_closed[] + INIT(= N_("E924: Current window was closed")); +EXTERN char e_current_quickfix_list_was_changed[] + INIT(= N_("E925: Current quickfix list was changed")); +EXTERN char e_current_location_list_was_changed[] + INIT(= N_("E926: Current location list was changed")); +EXTERN char e_invalid_action_str_1[] + INIT(= N_("E927: Invalid action: '%s'")); #ifdef FEAT_EVAL EXTERN char e_string_required[] INIT(= N_("E928: String required")); #endif +EXTERN char e_too_many_viminfo_temp_files_like_str[] + INIT(= N_("E929: Too many viminfo temp files, like %s!")); +EXTERN char e_cannot_use_redir_inside_execute[] + INIT(= N_("E930: Cannot use :redir inside execute()")); EXTERN char e_buffer_cannot_be_registered[] INIT(= N_("E931: Buffer cannot be registered")); #ifdef FEAT_EVAL @@ -2067,22 +2189,37 @@ EXTERN char e_closure_function_should_not_be_at_top_level[] EXTERN char e_function_was_deleted_str[] INIT(= N_("E933: Function was deleted: %s")); #endif +EXTERN char e_cannot_jump_to_buffer_that_does_not_have_name[] + INIT(= N_("E934: Cannot jump to a buffer that does not have a name")); +EXTERN char e_invalid_submatch_number_nr[] + INIT(= N_("E935: invalid submatch number: %d")); EXTERN char e_cannot_delete_current_group[] INIT(= N_("E936: Cannot delete the current group")); EXTERN char e_attempt_to_delete_buffer_that_is_in_use_str[] INIT(= N_("E937: Attempt to delete a buffer that is in use: %s")); +EXTERN char e_duplicate_key_in_json_str[] + INIT(= N_("E938: Duplicate key in JSON: \"%s\"")); EXTERN char e_positive_count_required[] INIT(= N_("E939: Positive count required")); #ifdef FEAT_EVAL EXTERN char e_cannot_lock_or_unlock_variable_str[] INIT(= N_("E940: Cannot lock or unlock variable %s")); #endif +EXTERN char e_already_started_server[] + INIT(= N_("E941: already started a server")); +EXTERN char e_clientserver_feature_not_available[] + INIT(= N_("E942: +clientserver feature not available")); +EXTERN char e_command_table_needs_to_be_updated_run_make_cmdidxs[] + INIT(= N_("E943: Command table needs to be updated, run 'make cmdidxs'")); EXTERN char e_reverse_range_in_character_class[] INIT(= N_("E944: Reverse range in character class")); EXTERN char e_range_too_large_in_character_class[] INIT(= N_("E945: Range too large in character class")); - +EXTERN char e_cannot_make_terminal_with_running_job_modifiable[] + INIT(= N_("E946: Cannot make a terminal with running job modifiable")); #ifdef FEAT_TERMINAL +EXTERN char e_job_still_running_in_buffer_str[] + INIT(= N_("E947: Job still running in buffer \"%s\"")); EXTERN char e_job_still_running[] INIT(= N_("E948: Job still running")); EXTERN char e_job_still_running_add_bang_to_end_the_job[] @@ -2090,40 +2227,123 @@ EXTERN char e_job_still_running_add_bang_to_end_the_job[] #endif EXTERN char e_file_changed_while_writing[] INIT(= N_("E949: File changed while writing")); - +EXTERN char e_cannot_convert_between_str_and_str[] + INIT(= N_("E950: Cannot convert between %s and %s")); EXTERN char e_percent_value_too_large[] INIT(= N_("E951: \\% value too large")); EXTERN char e_autocommand_caused_recursive_behavior[] INIT(= N_("E952: Autocommand caused recursive behavior")); +EXTERN char e_file_exists_str[] + INIT(= N_("E953: File exists: %s")); +EXTERN char e_24_bit_colors_are_not_supported_on_this_environment[] + INIT(= N_("E954: 24-bit colors are not supported on this environment")); +EXTERN char e_not_terminal_buffer[] + INIT(= N_("E955: Not a terminal buffer")); EXTERN char e_cannot_use_pattern_recursively[] INIT(= N_("E956: Cannot use pattern recursively")); EXTERN char e_invalid_window_number[] INIT(= N_("E957: Invalid window number")); +EXTERN char e_job_already_finished[] + INIT(= N_("E958: Job already finished")); +EXTERN char e_invalid_diff_format[] + INIT(= N_("E959: Invalid diff format.")); +EXTERN char e_problem_creating_internal_diff[] + INIT(= N_("E960: Problem creating the internal diff")); +EXTERN char e_no_line_number_to_use_for_sflnum[] + INIT(= N_("E961: no line number to use for \"<sflnum>\"")); +EXTERN char e_invalid_action_str_2[] + INIT(= N_("E962: Invalid action: '%s'")); +EXTERN char e_setting_str_to_value_with_wrong_type[] + INIT(= N_("E963: setting %s to value with wrong type")); EXTERN char_u e_invalid_column_number_nr[] INIT(= N_("E964: Invalid column number: %ld")); +EXTERN char e_missing_property_type_name[] + INIT(= N_("E965: missing property type name")); EXTERN char_u e_invalid_line_number_nr[] INIT(= N_("E966: Invalid line number: %ld")); +EXTERN char e_text_property_info_corrupted[] + INIT(= N_("E967: text property info corrupted")); +EXTERN char e_need_at_least_one_of_id_or_type[] + INIT(= N_("E968: Need at least one of 'id' or 'type'")); +EXTERN char e_property_type_str_already_defined[] + INIT(= N_("E969: Property type %s already defined")); +EXTERN char e_unknown_highlight_group_name_str[] + INIT(= N_("E970: Unknown highlight group name: '%s'")); +EXTERN char e_type_not_exist[] + INIT(= N_("E971: Property type %s does not exist")); EXTERN char e_blob_value_does_not_have_right_number_of_bytes[] INIT(= N_("E972: Blob value does not have the right number of bytes")); +EXTERN char e_blob_literal_should_have_an_even_number_of_hex_characters[] + INIT(= N_("E973: Blob literal should have an even number of hex characters")); +EXTERN char e_using_blob_as_number[] + INIT(= N_("E974: Using a Blob as a Number")); +EXTERN char e_using_blob_as_float[] + INIT(= N_("E975: Using a Blob as a Float")); +EXTERN char e_using_blob_as_string[] + INIT(= N_("E976: Using a Blob as a String")); +EXTERN char e_can_only_compare_blob_with_blob[] + INIT(= N_("E977: Can only compare Blob with Blob")); #ifdef FEAT_EVAL EXTERN char e_invalid_operation_for_blob[] INIT(= N_("E978: Invalid operation for Blob")); EXTERN char e_blob_index_out_of_range_nr[] INIT(= N_("E979: Blob index out of range: %ld")); #endif +EXTERN char e_lowlevel_input_not_supported[] + INIT(= N_("E980: lowlevel input not supported")); +EXTERN char e_command_not_allowed_in_rvim[] + INIT(= N_("E981: Command not allowed in rvim")); +EXTERN char e_conpty_is_not_available[] + INIT(= N_("E982: ConPTY is not available")); EXTERN char e_duplicate_argument_str[] INIT(= N_("E983: Duplicate argument: %s")); +EXTERN char e_scriptversion_used_outside_of_sourced_file[] + INIT(= N_("E984: :scriptversion used outside of a sourced file")); #ifdef FEAT_EVAL +EXTERN char e_dot_equal_not_supported_with_script_version_two[] + INIT(= N_("E985: .= is not supported with script version >= 2")); +EXTERN char e_cannot_modify_tag_stack_within_tagfunc[] + INIT(= N_("E986: cannot modify the tag stack within tagfunc")); +EXTERN char e_invalid_return_value_from_tagfunc[] + INIT(= N_("E987: invalid return value from tagfunc")); +#endif +EXTERN char e_gui_cannot_be_used_cannot_execute_gvim_exe[] + INIT(= N_("E988: GUI cannot be used. Cannot execute gvim.exe.")); +EXTERN char e_non_default_argument_follows_default_argument[] + INIT(= N_("E989: Non-default argument follows default argument")); +#ifdef FEAT_EVAL +EXTERN char e_missing_end_marker_str[] + INIT(= N_("E990: Missing end marker '%s'")); +EXTERN char e_cannot_use_heredoc_here[] + INIT(= N_("E991: cannot use =<< here")); +EXTERN char e_not_allowed_in_modeline_when_modelineexpr_is_off[] + INIT(= N_("E992: Not allowed in a modeline when 'modelineexpr' is off")); +EXTERN char e_window_nr_is_not_popup_window[] + INIT(= N_("E993: window %d is not a popup window")); +EXTERN char e_not_allowed_in_popup_window[] + INIT(= N_("E994: Not allowed in a popup window")); EXTERN char e_cannot_modify_existing_variable[] INIT(= N_("E995: Cannot modify existing variable")); -EXTERN char e_cannot_lock_an_option[] +EXTERN char e_cannot_lock_range[] + INIT(= N_("E996: Cannot lock a range")); +EXTERN char e_cannot_lock_option[] INIT(= N_("E996: Cannot lock an option")); +EXTERN char e_cannot_lock_list_or_dict[] + INIT(= N_("E996: Cannot lock a list or dict")); +EXTERN char e_cannot_lock_environment_variable[] + INIT(= N_("E996: Cannot lock an environment variable")); +EXTERN char e_cannot_lock_register[] + INIT(= N_("E996: Cannot lock a register")); +#endif +EXTERN char e_tabpage_not_found_nr[] + INIT(= N_("E997: Tabpage not found: %d")); +#ifdef FEAT_EVAL EXTERN char e_reduce_of_an_empty_str_with_no_initial_value[] INIT(= N_("E998: Reduce of an empty %s with no initial value")); #endif - -EXTERN char e_command_not_supported_in_vim9_script_missing_var_str[] - INIT(= N_("E1100: Command not supported in Vim9 script (missing :var?): %s")); +EXTERN char e_scriptversion_not_supported_nr[] + INIT(= N_("E999: scriptversion not supported: %d")); +// E1000 unused #ifdef FEAT_EVAL EXTERN char e_variable_not_found_str[] INIT(= N_("E1001: Variable not found: %s")); @@ -2329,6 +2549,10 @@ EXTERN char e_string_list_or_blob_required[] INIT(= N_("E1098: String, List or Blob required")); EXTERN char e_unknown_error_while_executing_str[] INIT(= N_("E1099: Unknown error while executing %s")); +#endif +EXTERN char e_command_not_supported_in_vim9_script_missing_var_str[] + INIT(= N_("E1100: Command not supported in Vim9 script (missing :var?): %s")); +#ifdef FEAT_EVAL EXTERN char e_cannot_declare_script_variable_in_function[] INIT(= N_("E1101: Cannot declare a script variable in a function: %s")); EXTERN char e_lambda_function_not_found_str[] diff --git a/src/evalfunc.c b/src/evalfunc.c index d435818310..27f8d46667 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -2889,7 +2889,7 @@ get_buf_arg(typval_T *arg) buf = tv_get_buf(arg, FALSE); --emsg_off; if (buf == NULL) - semsg(_("E158: Invalid buffer name: %s"), tv_get_string(arg)); + semsg(_(e_invalid_buffer_name_str), tv_get_string(arg)); return buf; } @@ -3983,7 +3983,7 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED) add_to_input_buf(keys + idx, 1); } #else - emsg(_("E980: lowlevel input not supported")); + emsg(_(e_lowlevel_input_not_supported)); #endif } else @@ -4147,7 +4147,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) { if (argvars[dict_idx].v_type != VAR_DICT) { - emsg(_("E922: expected a dict")); + emsg(_(e_expected_dict)); vim_free(name); goto theend; } @@ -4158,7 +4158,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) { if (argvars[arg_idx].v_type != VAR_LIST) { - emsg(_("E923: Second argument of function() must be a list or a dict")); + emsg(_(e_second_argument_of_function_must_be_list_or_dict)); vim_free(name); goto theend; } @@ -9199,7 +9199,6 @@ free_lstval: static void f_settagstack(typval_T *argvars, typval_T *rettv) { - static char *e_invact2 = N_("E962: Invalid action: '%s'"); win_T *wp; dict_T *d; int action = 'r'; @@ -9242,7 +9241,7 @@ f_settagstack(typval_T *argvars, typval_T *rettv) action = *actstr; else { - semsg(_(e_invact2), actstr); + semsg(_(e_invalid_action_str_2), actstr); return; } } @@ -9611,7 +9610,7 @@ f_submatch(typval_T *argvars, typval_T *rettv) return; if (no < 0 || no >= NSUBEXP) { - semsg(_("E935: invalid submatch number: %d"), no); + semsg(_(e_invalid_submatch_number_nr), no); return; } if (argvars[1].v_type != VAR_UNKNOWN) diff --git a/src/evalvars.c b/src/evalvars.c index 462cdc20ee..11770aa532 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -592,7 +592,7 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get) if (eap->getline == NULL) { - emsg(_("E991: cannot use =<< here")); + emsg(_(e_cannot_use_heredoc_here)); return NULL; } @@ -657,7 +657,7 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get) theline = eap->getline(NUL, eap->cookie, 0, FALSE); if (theline == NULL) { - semsg(_("E990: Missing end marker '%s'"), marker); + semsg(_(e_missing_end_marker_str), marker); break; } @@ -796,7 +796,7 @@ ex_let(exarg_T *eap) if (*arg == '[') emsg(_(e_invalid_argument)); else if (expr[0] == '.' && expr[1] == '=') - emsg(_("E985: .= is not supported with script version >= 2")); + emsg(_(e_dot_equal_not_supported_with_script_version_two)); else if (!ends_excmd2(eap->cmd, arg)) { if (vim9script) @@ -1309,7 +1309,7 @@ ex_let_env( if ((flags & (ASSIGN_CONST | ASSIGN_FINAL)) && (flags & ASSIGN_FOR_LOOP) == 0) { - emsg(_("E996: Cannot lock an environment variable")); + emsg(_(e_cannot_lock_environment_variable)); return NULL; } @@ -1376,7 +1376,7 @@ ex_let_option( if ((flags & (ASSIGN_CONST | ASSIGN_FINAL)) && (flags & ASSIGN_FOR_LOOP) == 0) { - emsg(_(e_cannot_lock_an_option)); + emsg(_(e_cannot_lock_option)); return NULL; } @@ -1502,7 +1502,7 @@ ex_let_register( if ((flags & (ASSIGN_CONST | ASSIGN_FINAL)) && (flags & ASSIGN_FOR_LOOP) == 0) { - emsg(_("E996: Cannot lock a register")); + emsg(_(e_cannot_lock_register)); return NULL; } ++arg; @@ -3493,7 +3493,7 @@ set_var_const( } else if (di->di_tv.v_type != tv->v_type) { - semsg(_("E963: setting %s to value with wrong type"), name); + semsg(_(e_setting_str_to_value_with_wrong_type), name); goto failed; } } @@ -4482,7 +4482,7 @@ get_callback(typval_T *arg) if (r == FAIL) { - emsg(_("E921: Invalid callback argument")); + emsg(_(e_invalid_callback_argument)); res.cb_name = NULL; } } diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index d2b45ab5c9..db82277aca 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -363,8 +363,7 @@ check_changed_any( if ( #ifdef FEAT_TERMINAL term_job_running(buf->b_term) - ? semsg(_("E947: Job still running in buffer \"%s\""), - buf->b_fname) + ? semsg(_(e_job_still_running_in_buffer_str), buf->b_fname) : #endif semsg(_(e_no_write_since_last_change_for_buffer_str), diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 1df6e236f8..ea6dbb64c2 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2082,7 +2082,7 @@ do_one_cmd( #endif if (restricted != 0 && (ea.argt & EX_RESTRICT)) { - errormsg = _("E981: Command not allowed in rvim"); + errormsg = _(e_command_not_allowed_in_rvim); goto doend; } if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY)) @@ -3715,7 +3715,7 @@ find_ex_command( if (command_count != (int)CMD_SIZE) { - iemsg(_("E943: Command table needs to be updated, run 'make cmdidxs'")); + iemsg(_(e_command_table_needs_to_be_updated_run_make_cmdidxs)); getout(1); } @@ -8058,7 +8058,7 @@ ex_redir(exarg_T *eap) #ifdef FEAT_EVAL if (redir_execute) { - emsg(_("E930: Cannot use :redir inside execute()")); + emsg(_(e_cannot_use_redir_inside_execute)); return; } #endif @@ -9158,7 +9158,7 @@ eval_vars( case SPEC_SFLNUM: // line in script file if (current_sctx.sc_lnum + SOURCING_LNUM == 0) { - *errormsg = _("E961: no line number to use for \"<sflnum>\""); + *errormsg = _(e_no_line_number_to_use_for_sflnum) |