# HG changeset patch # User Bram Moolenaar # Date 1641151804 -3600 # Node ID d4e61d61afd963635eb5176c3ced368f3e1dd643 # Parent e6751c1e2a8e5e2918a659cc712d80bdc9d85aaa patch 8.2.3985: error messages are spread out Commit: https://github.com/vim/vim/commit/ac78dd4a352196ca4e6640f8e4caaf126afd49e3 Author: Bram Moolenaar Date: Sun Jan 2 19:25:26 2022 +0000 patch 8.2.3985: error messages are spread out Problem: Error messages are spread out. Solution: Move more error messages to errors.h. diff --git a/src/errors.h b/src/errors.h --- a/src/errors.h +++ b/src/errors.h @@ -812,27 +812,213 @@ EXTERN char e_no_string_under_cursor[] INIT(= N_("E348: No string under cursor")); EXTERN char e_no_identifier_under_cursor[] INIT(= N_("E349: No identifier under cursor")); - +EXTERN char e_cannot_create_fold_with_current_foldmethod[] + INIT(= N_("E350: Cannot create fold with current 'foldmethod'")); +EXTERN char e_cannot_delete_fold_with_current_foldmethod[] + INIT(= N_("E351: Cannot delete fold with current 'foldmethod'")); +EXTERN char e_cannot_erase_folds_with_current_foldmethod[] + INIT(= N_("E352: Cannot erase folds with current 'foldmethod'")); +EXTERN char e_nothing_in_register_str[] + INIT(= N_("E353: Nothing in register %s")); +EXTERN char e_invalid_register_name_str[] + INIT(= N_("E354: Invalid register name: '%s'")); +EXTERN char e_unknown_option_str_2[] + INIT(= N_("E355: Unknown option: %s")); +EXTERN char e_get_varp_error[] + INIT(= N_("E356: get_varp ERROR")); +EXTERN char e_langmap_matching_character_missing_for_str[] + INIT(= N_("E357: 'langmap': Matching character missing for %s")); +EXTERN char e_langmap_extra_characters_after_semicolon_str[] + INIT(= N_("E358: 'langmap': Extra characters after semicolon: %s")); #if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN) \ || defined(UNIX) || defined(VMS) EXTERN char e_screen_mode_setting_not_supported[] INIT(= N_("E359: Screen mode setting not supported")); #endif +EXTERN char e_cannot_execute_shell_with_f_option[] + INIT(= N_("E360: Cannot execute shell with -f option")); +// E361 unused +EXTERN char e_using_boolean_valud_as_float[] + INIT(= N_("E362: Using a boolean value as a Float")); EXTERN char e_pattern_uses_more_memory_than_maxmempattern[] INIT(= N_("E363: pattern uses more memory than 'maxmempattern'")); #ifdef FEAT_LIBCALL EXTERN char e_library_call_failed_for_str[] INIT(= N_("E364: Library call failed for \"%s()\"")); #endif +#ifdef FEAT_POSTSCRIPT +EXTERN char e_failed_to_print_postscript_file[] + INIT(= N_("E365: Failed to print PostScript file")); +#endif +EXTERN char e_not_allowed_to_enter_popup_window[] + INIT(= N_("E366: Not allowed to enter a popup window")); EXTERN char e_no_such_group_str[] INIT(= N_("E367: No such group: \"%s\"")); +#ifdef FEAT_LIBCALL +EXTERN char e_got_sig_str_in_libcall[] + INIT(= N_("E368: got SIG%s in libcall()")); +#endif +EXTERN char e_invalid_item_in_str_brackets[] + INIT(= N_("E369: invalid item in %s%%[]")); #ifdef USING_LOAD_LIBRARY EXTERN char e_could_not_load_library_str_str[] INIT(= N_("E370: Could not load library %s: %s")); #endif +#ifdef FEAT_GUI_MSWIN +EXTERN char e_command_not_found[] + INIT(= N_("E371: Command not found")); +#endif +EXTERN char e_too_many_chr_in_format_string[] + INIT(= N_("E372: Too many %%%c in format string")); +EXTERN char e_unexpected_chr_in_format_str[] + INIT(= N_("E373: Unexpected %%%c in format string")); +EXTERN char e_missing_rsb_in_format_string[] + INIT(= N_("E374: Missing ] in format string")); +EXTERN char e_unsupported_chr_in_format_string[] + INIT(= N_("E375: Unsupported %%%c in format string")); +EXTERN char e_invalid_chr_in_format_string_prefix[] + INIT(= N_("E376: Invalid %%%c in format string prefix")); +EXTERN char e_invalid_chr_in_format_string[] + INIT(= N_("E377: Invalid %%%c in format string")); +EXTERN char e_errorformat_contains_no_pattern[] + INIT(= N_("E378: 'errorformat' contains no pattern")); +EXTERN char e_missing_or_empty_directory_name[] + INIT(= N_("E379: Missing or empty directory name")); +EXTERN char e_at_bottom_of_quickfix_stack[] + INIT(= N_("E380: At bottom of quickfix stack")); +EXTERN char e_at_top_of_quickfix_stack[] + INIT(= N_("E381: At top of quickfix stack")); EXTERN char e_cannot_write_buftype_option_is_set[] INIT(= N_("E382: Cannot write, 'buftype' option is set")); - +EXTERN char e_invalid_search_string_str[] + INIT(= N_("E383: Invalid search string: %s")); +EXTERN char e_search_hit_top_without_match_for_str[] + INIT(= N_("E384: search hit TOP without match for: %s")); +EXTERN char e_search_hit_bottom_without_match_for_str[] + INIT(= N_("E385: search hit BOTTOM without match for: %s")); +EXTERN char e_expected_question_or_slash_after_semicolon[] + INIT(= N_("E386: Expected '?' or '/' after ';'")); +EXTERN char e_match_is_on_current_line[] + INIT(= N_("E387: Match is on current line")); +EXTERN char e_couldnt_find_definition[] + INIT(= N_("E388: Couldn't find definition")); +EXTERN char e_couldnt_find_pattern[] + INIT(= N_("E389: Couldn't find pattern")); +EXTERN char e_illegal_argument_str_2[] + INIT(= N_("E390: Illegal argument: %s")); +EXTERN char e_no_such_syntax_cluster_1[] + INIT(= N_("E391: No such syntax cluster: %s")); +EXTERN char e_no_such_syntax_cluster_2[] + INIT(= N_("E392: No such syntax cluster: %s")); +EXTERN char e_groupthere_not_accepted_here[] + INIT(= N_("E393: group[t]here not accepted here")); +EXTERN char e_didnt_find_region_item_for_str[] + INIT(= N_("E394: Didn't find region item for %s")); +EXTERN char e_contains_argument_not_accepted_here[] + INIT(= N_("E395: contains argument not accepted here")); +// E396 unused +EXTERN char e_filename_required[] + INIT(= N_("E397: Filename required")); +EXTERN char e_missing_equal_str[] + INIT(= N_("E398: Missing '=': %s")); +EXTERN char e_not_enough_arguments_syntax_region_str[] + INIT(= N_("E399: Not enough arguments: syntax region %s")); +EXTERN char e_no_cluster_specified[] + INIT(= N_("E400: No cluster specified")); +EXTERN char e_pattern_delimiter_not_found_str[] + INIT(= N_("E401: Pattern delimiter not found: %s")); +EXTERN char e_garbage_after_pattern_str[] + INIT(= N_("E402: Garbage after pattern: %s")); +EXTERN char e_syntax_sync_line_continuations_pattern_specified_twice[] + INIT(= N_("E403: syntax sync: line continuations pattern specified twice")); +EXTERN char e_illegal_arguments_str[] + INIT(= N_("E404: Illegal arguments: %s")); +EXTERN char e_missing_equal_sign_str[] + INIT(= N_("E405: Missing equal sign: %s")); +EXTERN char e_empty_argument_str[] + INIT(= N_("E406: Empty argument: %s")); +EXTERN char e_str_not_allowed_here[] + INIT(= N_("E407: %s not allowed here")); +EXTERN char e_str_must_be_first_in_contains_list[] + INIT(= N_("E408: %s must be first in contains list")); +EXTERN char e_unknown_group_name_str[] + INIT(= N_("E409: Unknown group name: %s")); +EXTERN char e_invalid_syntax_subcommand_str[] + INIT(= N_("E410: Invalid :syntax subcommand: %s")); +EXTERN char e_highlight_group_name_not_found_str[] + INIT(= N_("E411: highlight group not found: %s")); +EXTERN char e_not_enough_arguments_highlight_link_str[] + INIT(= N_("E412: Not enough arguments: \":highlight link %s\"")); +EXTERN char e_too_many_arguments_highlight_link_str[] + INIT(= N_("E413: Too many arguments: \":highlight link %s\"")); +EXTERN char e_group_has_settings_highlight_link_ignored[] + INIT(= N_("E414: group has settings, highlight link ignored")); +EXTERN char e_unexpected_equal_sign_str[] + INIT(= N_("E415: unexpected equal sign: %s")); +EXTERN char e_missing_equal_sign_str_2[] + INIT(= N_("E416: missing equal sign: %s")); +EXTERN char e_missing_argument_str[] + INIT(= N_("E417: missing argument: %s")); +EXTERN char e_illegal_value_str[] + INIT(= N_("E418: Illegal value: %s")); +EXTERN char e_fg_color_unknown[] + INIT(= N_("E419: FG color unknown")); +EXTERN char e_bg_color_unknown[] + INIT(= N_("E420: BG color unknown")); +EXTERN char e_color_name_or_number_not_recognized[] + INIT(= N_("E421: Color name or number not recognized: %s")); +EXTERN char e_terminal_code_too_long_str[] + INIT(= N_("E422: terminal code too long: %s")); +EXTERN char e_illegal_argument_str_3[] + INIT(= N_("E423: Illegal argument: %s")); +EXTERN char e_too_many_different_highlighting_attributes_in_use[] + INIT(= N_("E424: Too many different highlighting attributes in use")); +EXTERN char e_cannot_go_before_first_matching_tag[] + INIT(= N_("E425: Cannot go before first matching tag")); +EXTERN char e_tag_not_found_str[] + INIT(= N_("E426: tag not found: %s")); +EXTERN char e_there_is_only_one_matching_tag[] + INIT(= N_("E427: There is only one matching tag")); +EXTERN char e_cannot_go_beyond_last_matching_tag[] + INIT(= N_("E428: Cannot go beyond last matching tag")); +EXTERN char e_file_str_does_not_exist[] + INIT(= N_("E429: File \"%s\" does not exist")); +EXTERN char e_tag_file_path_truncated_for_str[] + INIT(= N_("E430: Tag file path truncated for %s\n")); +EXTERN char e_format_error_in_tags_file_str[] + INIT(= N_("E431: Format error in tags file \"%s\"")); +EXTERN char e_tags_file_not_sorted_str[] + INIT(= N_("E432: Tags file not sorted: %s")); +EXTERN char e_no_tags_file[] + INIT(= N_("E433: No tags file")); +EXTERN char e_canot_find_tag_pattern[] + INIT(= N_("E434: Can't find tag pattern")); +EXTERN char e_couldnt_find_tag_just_guessing[] + INIT(= N_("E435: Couldn't find tag, just guessing!")); +EXTERN char e_no_str_entry_in_termcap[] + INIT(= N_("E436: No \"%s\" entry in termcap")); +EXTERN char e_terminal_capability_cm_required[] + INIT(= N_("E437: terminal capability \"cm\" required")); +EXTERN char e_u_undo_line_numbers_wrong[] + INIT(= N_("E438: u_undo: line numbers wrong")); +EXTERN char e_undo_list_corrupt[] + INIT(= N_("E439: undo list corrupt")); +EXTERN char e_undo_line_missing[] + INIT(= N_("E440: undo line missing")); +EXTERN char e_there_is_no_preview_window[] + INIT(= N_("E441: There is no preview window")); +EXTERN char e_cant_split_topleft_and_botright_at_the_same_time[] + INIT(= N_("E442: Can't split topleft and botright at the same time")); +EXTERN char e_cannot_rotate_when_another_window_is_split[] + INIT(= N_("E443: Cannot rotate when another window is split")); +EXTERN char e_cannot_close_last_window[] + INIT(= N_("E444: Cannot close last window")); +EXTERN char e_other_window_contains_changes[] + INIT(= N_("E445: Other window contains changes")); +EXTERN char e_no_file_name_under_cursor[] + INIT(= N_("E446: No file name under cursor")); +EXTERN char e_cant_find_file_str_in_path_2[] + INIT(= N_("E447: Can't find file \"%s\" in path")); #ifdef USING_LOAD_LIBRARY EXTERN char e_could_not_load_library_function_str[] INIT(= N_("E448: Could not load library function %s")); @@ -841,6 +1027,7 @@ EXTERN char e_could_not_load_library_fun EXTERN char e_invalid_expression_received[] INIT(= N_("E449: Invalid expression received")); #endif + #if defined(UNIX) || defined(FEAT_SESSION) EXTERN char e_cannot_go_back_to_previous_directory[] INIT(= N_("E459: Cannot go back to previous directory")); diff --git a/src/findfile.c b/src/findfile.c --- a/src/findfile.c +++ b/src/findfile.c @@ -2007,7 +2007,7 @@ file_name_in_line( if (*ptr == NUL) // nothing found { if (options & FNAME_MESS) - emsg(_("E446: No file name under cursor")); + emsg(_(e_no_file_name_under_cursor)); return NULL; } @@ -2165,7 +2165,7 @@ find_file_name_in_path( { c = ptr[len]; ptr[len] = NUL; - semsg(_("E447: Can't find file \"%s\" in path"), ptr); + semsg(_(e_cant_find_file_str_in_path_2), ptr); ptr[len] = c; } diff --git a/src/fold.c b/src/fold.c --- a/src/fold.c +++ b/src/fold.c @@ -563,9 +563,9 @@ foldManualAllowed(int create) if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin)) return TRUE; if (create) - emsg(_("E350: Cannot create fold with current 'foldmethod'")); + emsg(_(e_cannot_create_fold_with_current_foldmethod)); else - emsg(_("E351: Cannot delete fold with current 'foldmethod'")); + emsg(_(e_cannot_delete_fold_with_current_foldmethod)); return FALSE; } diff --git a/src/hardcopy.c b/src/hardcopy.c --- a/src/hardcopy.c +++ b/src/hardcopy.c @@ -3135,7 +3135,7 @@ mch_print_end(prt_settings_T *psettings) // Not printing to a file: use 'printexpr' to print the file. if (eval_printexpr(prt_ps_file_name, psettings->arguments) == FAIL) - emsg(_("E365: Failed to print PostScript file")); + emsg(_(e_failed_to_print_postscript_file)); else prt_message((char_u *)_("Print job sent.")); } diff --git a/src/highlight.c b/src/highlight.c --- a/src/highlight.c +++ b/src/highlight.c @@ -656,7 +656,7 @@ highlight_group_link( && hl_has_settings(from_id - 1, dodefault)) { if (SOURCING_NAME == NULL && !dodefault) - emsg(_("E414: group has settings, highlight link ignored")); + emsg(_(e_group_has_settings_highlight_link_ignored)); } else if (hlgroup->sg_link != to_id #ifdef FEAT_EVAL @@ -781,7 +781,7 @@ highlight_set_termgui_attr(int idx, char } if (i < 0) { - semsg(_("E418: Illegal value: %s"), arg); + semsg(_(e_illegal_value_str), arg); return FALSE; } if (arg[off] == ',') // another one follows @@ -1033,7 +1033,7 @@ highlight_set_cterm_color( color = cterm_normal_fg_color - 1; else { - emsg(_("E419: FG color unknown")); + emsg(_(e_fg_color_unknown)); return FALSE; } } @@ -1043,7 +1043,7 @@ highlight_set_cterm_color( color = cterm_normal_bg_color - 1; else { - emsg(_("E420: BG color unknown")); + emsg(_(e_bg_color_unknown)); return FALSE; } } @@ -1069,8 +1069,7 @@ highlight_set_cterm_color( break; if (i < 0) { - semsg(_("E421: Color name or number not recognized: %s"), - key_start); + semsg(_(e_color_name_or_number_not_recognized), key_start); return FALSE; } @@ -1323,7 +1322,7 @@ highlight_set_startstop_termcode(int idx // Append it to the already found stuff if ((int)(STRLEN(buf) + STRLEN(p)) >= 99) { - semsg(_("E422: terminal code too long: %s"), arg); + semsg(_(e_terminal_code_too_long_str), arg); return FALSE; } STRCAT(buf, p); @@ -1440,7 +1439,7 @@ do_highlight( { id = syn_namen2id(line, (int)(name_end - line)); if (id == 0) - semsg(_("E411: highlight group not found: %s"), line); + semsg(_(e_highlight_group_name_not_found_str), line); else highlight_list_one(id); return; @@ -1462,15 +1461,13 @@ do_highlight( if (ends_excmd2(line, from_start) || ends_excmd2(line, to_start)) { - semsg(_("E412: Not enough arguments: \":highlight link %s\""), - from_start); + semsg(_(e_not_enough_arguments_highlight_link_str), from_start); return; } if (!ends_excmd2(line, skipwhite(to_end))) { - semsg(_("E413: Too many arguments: \":highlight link %s\""), - from_start); + semsg(_(e_too_many_arguments_highlight_link_str), from_start); return; } @@ -1533,7 +1530,7 @@ do_highlight( key_start = linep; if (*linep == '=') { - semsg(_("E415: unexpected equal sign: %s"), key_start); + semsg(_(e_unexpected_equal_sign_str), key_start); error = TRUE; break; } @@ -1565,7 +1562,7 @@ do_highlight( // Check for the equal sign. if (*linep != '=') { - semsg(_("E416: missing equal sign: %s"), key_start); + semsg(_(e_missing_equal_sign_str_2), key_start); error = TRUE; break; } @@ -1591,7 +1588,7 @@ do_highlight( } if (linep == arg_start) { - semsg(_("E417: missing argument: %s"), key_start); + semsg(_(e_missing_argument_str), key_start); error = TRUE; break; } @@ -1671,7 +1668,7 @@ do_highlight( } else { - semsg(_("E423: Illegal argument: %s"), key_start); + semsg(_(e_illegal_argument_str_3), key_start); error = TRUE; break; } @@ -2529,7 +2526,7 @@ get_attr_entry(garray_T *table, attrentr // When called recursively, we are really out of numbers. if (recursive) { - emsg(_("E424: Too many different highlighting attributes in use")); + emsg(_(e_too_many_different_highlighting_attributes_in_use)); return 0; } recursive = TRUE; diff --git a/src/map.c b/src/map.c --- a/src/map.c +++ b/src/map.c @@ -2706,7 +2706,7 @@ langmap_set(void) } if (to == NUL) { - semsg(_("E357: 'langmap': Matching character missing for %s"), + semsg(_(e_langmap_matching_character_missing_for_str), transchar(from)); return; } @@ -2728,7 +2728,7 @@ langmap_set(void) { if (p[0] != ',') { - semsg(_("E358: 'langmap': Extra characters after semicolon: %s"), p); + semsg(_(e_langmap_extra_characters_after_semicolon_str), p); return; } ++p; diff --git a/src/message.c b/src/message.c --- a/src/message.c +++ b/src/message.c @@ -891,7 +891,7 @@ internal_error_no_abort(char *where) void emsg_invreg(int name) { - semsg(_("E354: Invalid register name: '%s'"), transchar(name)); + semsg(_(e_invalid_register_name_str), transchar(name)); } /* diff --git a/src/normal.c b/src/normal.c --- a/src/normal.c +++ b/src/normal.c @@ -3080,7 +3080,7 @@ dozet: deleteFold((linenr_T)1, curbuf->b_ml.ml_line_count, TRUE, FALSE); else - emsg(_("E352: Cannot erase folds with current 'foldmethod'")); + emsg(_(e_cannot_erase_folds_with_current_foldmethod)); break; // "zn": fold none: reset 'foldenable' diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -4352,7 +4352,7 @@ set_option_value( return NULL; } - semsg(_("E355: Unknown option: %s"), name); + semsg(_(e_unknown_option_str_2), name); } else { @@ -5520,7 +5520,7 @@ get_varp(struct vimoption *p) case PV_VSTS: return (char_u *)&(curbuf->b_p_vsts); case PV_VTS: return (char_u *)&(curbuf->b_p_vts); #endif - default: iemsg(_("E356: get_varp ERROR")); + default: iemsg(_(e_get_varp_error)); } // always return a valid pointer to avoid a crash! return (char_u *)&(curbuf->b_p_wm); diff --git a/src/os_amiga.c b/src/os_amiga.c --- a/src/os_amiga.c +++ b/src/os_amiga.c @@ -1256,7 +1256,7 @@ mch_call_shell( if (close_win) { // if Vim opened a window: Executing a shell may cause crashes - emsg(_("E360: Cannot execute shell with -f option")); + emsg(_(e_cannot_execute_shell_with_f_option)); return -1; } diff --git a/src/os_unix.c b/src/os_unix.c --- a/src/os_unix.c +++ b/src/os_unix.c @@ -7575,7 +7575,7 @@ mch_libcall( for (i = 0; signal_info[i].sig != -1; i++) if (lc_signal == signal_info[i].sig) break; - semsg("E368: got SIG%s in libcall()", signal_info[i].name); + semsg(e_got_sig_str_in_libcall, signal_info[i].name); } # endif # endif diff --git a/src/os_win32.c b/src/os_win32.c --- a/src/os_win32.c +++ b/src/os_win32.c @@ -4954,7 +4954,7 @@ mch_call_shell( # ifdef VIMDLL if (gui.in_use) # endif - emsg(_("E371: Command not found")); + emsg(_(e_command_not_found)); #endif } diff --git a/src/quickfix.c b/src/quickfix.c --- a/src/quickfix.c +++ b/src/quickfix.c @@ -268,7 +268,7 @@ efmpat_to_regpat( if (efminfo->addr[idx]) { // Each errorformat pattern can occur only once - semsg(_("E372: Too many %%%c in format string"), *efmpat); + semsg(_(e_too_many_chr_in_format_string), *efmpat); return NULL; } if ((idx && idx < 6 @@ -276,7 +276,7 @@ efmpat_to_regpat( || (idx == 6 && vim_strchr((char_u *)"OPQ", efminfo->prefix) == NULL)) { - semsg(_("E373: Unexpected %%%c in format string"), *efmpat); + semsg(_(e_unexpected_chr_in_format_str), *efmpat); return NULL; } efminfo->addr[idx] = (char_u)++round; @@ -351,7 +351,7 @@ scanf_fmt_to_regpat( // skip ; if (efmp == efm + len) { - emsg(_("E374: Missing ] in format string")); + emsg(_(e_missing_rsb_in_format_string)); return NULL; } } @@ -364,7 +364,7 @@ scanf_fmt_to_regpat( else { // TODO: scanf()-like: %*ud, %*3c, %*f, ... ? - semsg(_("E375: Unsupported %%%c in format string"), *efmp); + semsg(_(e_unsupported_chr_in_format_string), *efmp); return NULL; } @@ -385,7 +385,7 @@ efm_analyze_prefix(char_u *efmp, efm_T * efminfo->prefix = *efmp; else { - semsg(_("E376: Invalid %%%c in format string prefix"), *efmp); + semsg(_(e_invalid_chr_in_format_string_prefix), *efmp); return NULL; } @@ -452,7 +452,7 @@ efm_to_regpat( } else { - semsg(_("E377: Invalid %%%c in format string"), *efmp); + semsg(_(e_invalid_chr_in_format_string), *efmp); return FAIL; } } @@ -573,7 +573,7 @@ parse_efm_option(char_u *efm) } if (fmt_first == NULL) // nothing found - emsg(_("E378: 'errorformat' contains no pattern")); + emsg(_(e_errorformat_contains_no_pattern)); goto parse_efm_end; @@ -1273,7 +1273,7 @@ qf_parse_dir_pfx(int idx, qffields_T *fi { if (*fields->namebuf == NUL) { - emsg(_("E379: Missing or empty directory name")); + emsg(_(e_missing_or_empty_directory_name)); return QF_FAIL; } qfl->qf_directory = @@ -3787,7 +3787,7 @@ qf_age(exarg_T *eap) { if (qi->qf_curlist == 0) { - emsg(_("E380: At bottom of quickfix stack")); + emsg(_(e_at_bottom_of_quickfix_stack)); break; } --qi->qf_curlist; @@ -3796,7 +3796,7 @@ qf_age(exarg_T *eap) { if (qi->qf_curlist >= qi->qf_listcount - 1) { - emsg(_("E381: At top of quickfix stack")); + emsg(_(e_at_top_of_quickfix_stack)); break; } ++qi->qf_curlist; diff --git a/src/regexp.c b/src/regexp.c --- a/src/regexp.c +++ b/src/regexp.c @@ -66,7 +66,7 @@ toggle_Magic(int x) #define EMSG2_RET_NULL(m, c) return (semsg((const char *)(m), (c) ? "" : "\\"), rc_did_emsg = TRUE, (void *)NULL) #define EMSG3_RET_NULL(m, c, a) return (semsg((const char *)(m), (c) ? "" : "\\", (a)), rc_did_emsg = TRUE, (void *)NULL) #define EMSG2_RET_FAIL(m, c) return (semsg((const char *)(m), (c) ? "" : "\\"), rc_did_emsg = TRUE, FAIL) -#define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL) +#define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_(e_invalid_item_in_str_brackets), reg_magic == MAGIC_ALL) #define MAX_LIMIT (32767L << 16L) diff --git a/src/register.c b/src/register.c --- a/src/register.c +++ b/src/register.c @@ -1691,7 +1691,7 @@ do_put( if (y_size == 0 || y_array == NULL) { - semsg(_("E353: Nothing in register %s"), + semsg(_(e_nothing_in_register_str), regname == 0 ? (char_u *)"\"" : transchar(regname)); goto end; } diff --git a/src/search.c b/src/search.c --- a/src/search.c +++ b/src/search.c @@ -655,7 +655,7 @@ searchit( (options & (SEARCH_HIS + SEARCH_KEEP)), ®match) == FAIL) { if ((options & SEARCH_MSG) && !rc_did_emsg) - semsg(_("E383: Invalid search string: %s"), mr_pattern); + semsg(_(e_invalid_search_string_str), mr_pattern); return FAIL; } @@ -1126,11 +1126,9 @@ searchit( if (p_ws) semsg(_(e_pattern_not_found_str), mr_pattern); else if (lnum == 0) - semsg(_("E384: search hit TOP without match for: %s"), - mr_pattern); + semsg(_(e_search_hit_top_without_match_for_str), mr_pattern); else - semsg(_("E385: search hit BOTTOM without match for: %s"), - mr_pattern); + semsg(_(e_search_hit_bottom_without_match_for_str), mr_pattern); } return FAIL; } @@ -1646,7 +1644,7 @@ do_search( if (dirc != '?' && dirc != '/') { retval = 0; - emsg(_("E386: Expected '?' or '/' after ';'")); + emsg(_(e_expected_question_or_slash_after_semicolon)); goto end_do_search; } ++pat; @@ -3832,7 +3830,7 @@ search_line: && g_do_tagpreview == 0 #endif ) - emsg(_("E387: Match is on current line")); + emsg(_(e_match_is_on_current_line)); else if (action == ACTION_SHOW) { show_pat_in_path(line, type, did_show, action, @@ -3992,9 +3990,9 @@ exit_matched: if (got_int || ins_compl_interrupted()) emsg(_(e_interrupted)); else if (type == FIND_DEFINE) - emsg(_("E388: Couldn't find definition")); + emsg(_(e_couldnt_find_definition)); else - emsg(_("E389: Couldn't find pattern")); + emsg(_(e_couldnt_find_pattern)); } if (action == ACTION_SHOW || action == ACTION_SHOW_ALL) msg_end(); diff --git a/src/syntax.c b/src/syntax.c --- a/src/syntax.c +++ b/src/syntax.c @@ -30,8 +30,6 @@ static char *(spo_name_tab[SPO_COUNT]) = {"ms=", "me=", "hs=", "he=", "rs=", "re=", "lc="}; -static char e_illegal_arg[] = N_("E390: Illegal argument: %s"); - /* * The patterns that are being searched for are stored in a syn_pattern. * A match item consists of one pattern. @@ -3340,7 +3338,7 @@ syn_cmd_conceal(exarg_T *eap UNUSED, int else if (STRNICMP(arg, "off", 3) == 0 && next - arg == 3) curwin->w_s->b_syn_conceal = FALSE; else - semsg(_(e_illegal_arg), arg); + semsg(_(e_illegal_argument_str_2), arg); #endif } @@ -3370,7 +3368,7 @@ syn_cmd_case(exarg_T *eap, int syncing U else if (STRNICMP(arg, "ignore", 6) == 0 && next - arg == 6) curwin->w_s->b_syn_ic = TRUE; else - semsg(_(e_illegal_arg), arg); + semsg(_(e_illegal_argument_str_2), arg); } /* @@ -3404,14 +3402,14 @@ syn_cmd_foldlevel(exarg_T *eap, int sync curwin->w_s->b_syn_foldlevel = SYNFLD_MINIMUM; else { - semsg(_(e_illegal_arg), arg); + semsg(_(e_illegal_argument_str_2), arg); return; } arg = skipwhite(arg_end); if (*arg != NUL) { - semsg(_(e_illegal_arg), arg); + semsg(_(e_illegal_argument_str_2), arg); } } @@ -3446,7 +3444,7 @@ syn_cmd_spell(exarg_T *eap, int syncing curwin->w_s->b_syn_spell = SYNSPL_DEFAULT; else { - semsg(_(e_illegal_arg), arg); + semsg(_(e_illegal_argument_str_2), arg); return; } @@ -3703,7 +3701,7 @@ syn_cmd_clear(exarg_T *eap, int syncing) id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1)); if (id == 0) { - semsg(_("E391: No such syntax cluster: %s"), arg); + semsg(_(e_no_such_syntax_cluster_1), arg); break; } else @@ -3913,7 +3911,7 @@ syn_cmd_list( { id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1)); if (id == 0) - semsg(_("E392: No such syntax cluster: %s"), arg); + semsg(_(e_no_such_syntax_cluster_2), arg); else syn_list_cluster(id - SYNID_CLUSTER); } @@ -4600,7 +4598,7 @@ get_syn_options( { if (!opt->has_cont_list) { - emsg(_("E395: contains argument not accepted here")); + emsg(_(e_contains_argument_not_accepted_here)); return NULL; } if (get_id_list(&arg, 8, &opt->cont_list, skip) == FAIL) @@ -4653,7 +4651,7 @@ get_syn_options( { if (opt->sync_idx == NULL) { - emsg(_("E393: group[t]here not accepted here")); + emsg(_(e_groupthere_not_accepted_here)); return NULL; } gname_start = arg; @@ -4678,7 +4676,7 @@ get_syn_options( } if (i < 0) { - semsg(_("E394: Didn't find region item for %s"), gname); + semsg(_(e_didnt_find_region_item_for_str), gname); vim_free(gname); return NULL; } @@ -4751,7 +4749,7 @@ syn_cmd_include(exarg_T *eap, int syncin rest = get_group_name(arg, &group_name_end); if (rest == NULL) { - emsg(_("E397: Filename required")); + emsg(_(e_filename_required)); return; } sgl_id = syn_check_cluster(arg, (int)(group_name_end - arg)); @@ -5133,7 +5131,7 @@ syn_cmd_region( if (*rest != '=') { rest = NULL; - semsg(_("E398: Missing '=': %s"), arg); + semsg(_(e_missing_equal_str), arg); break; } rest = skipwhite(rest + 1); @@ -5296,7 +5294,7 @@ syn_cmd_region( vim_free(syn_opt_arg.cont_in_list); vim_free(syn_opt_arg.next_list); if (not_enough) - semsg(_("E399: Not enough arguments: syntax region %s"), arg); + semsg(_(e_not_enough_arguments_syntax_region_str), arg); else if (illegal || rest == NULL) semsg(_(e_invalid_argument_str), arg); } @@ -5626,7 +5624,7 @@ syn_cmd_cluster(exarg_T *eap, int syncin } if (!got_clstr) - emsg(_("E400: No cluster specified")); + emsg(_(e_no_cluster_specified)); if (rest == NULL || !ends_excmd2(eap->cmd, rest)) semsg(_(e_invalid_argument_str), arg); } @@ -5661,7 +5659,7 @@ get_syn_pattern(char_u *arg, synpat_T *c end = skip_regexp(arg + 1, *arg, TRUE); if (*end != *arg) // end delimiter not found { - semsg(_("E401: Pattern delimiter not found: %s"), arg); + semsg(_(e_pattern_delimiter_not_found_str), arg); return NULL; } // store the pattern and compiled regexp program @@ -5739,7 +5737,7 @@ get_syn_pattern(char_u *arg, synpat_T *c if (!ends_excmd2(arg, end) && !VIM_ISWHITE(*end)) { - semsg(_("E402: Garbage after pattern: %s"), arg); + semsg(_(e_garbage_after_pattern_str), arg); return NULL; } return skipwhite(end); @@ -5833,7 +5831,7 @@ syn_cmd_sync(exarg_T *eap, int syncing U } if (curwin->w_s->b_syn_linecont_pat != NULL) { - emsg(_("E403: syntax sync: line continuations pattern specified twice")); + emsg(_(e_syntax_sync_line_continuations_pattern_specified_twice)); finished = TRUE; break; } @@ -5893,7 +5891,7 @@ syn_cmd_sync(exarg_T *eap, int syncing U } vim_free(key); if (illegal) - semsg(_("E404: Illegal arguments: %s"), arg_start); + semsg(_(e_illegal_arguments_str), arg_start); else if (!finished) { set_nextcmd(eap, arg_start); @@ -5944,13 +5942,13 @@ get_id_list( p = skipwhite(*arg + keylen); if (*p != '=') { - semsg(_("E405: Missing equal sign: %s"), *arg); + semsg(_(e_missing_equal_sign_str), *arg); break; } p = skipwhite(p + 1); if (ends_excmd2(*arg, p)) { - semsg(_("E406: Empty argument: %s"), *arg); + semsg(_(e_empty_argument_str), *arg); break; } @@ -5976,15 +5974,14 @@ get_id_list( { if (TOUPPER_ASC(**arg) != 'C') { - semsg(_("E407: %s not allowed here"), name + 1); + semsg(_(e_str_not_allowed_here), name + 1); failed = TRUE; vim_free(name); break; } if (count != 0) { - semsg(_("E408: %s must be first in contains list"), - name + 1); + semsg(_(e_str_must_be_first_in_contains_list), name + 1); failed = TRUE; vim_free(name); break; @@ -6062,7 +6059,7 @@ get_id_list( vim_free(name); if (id == 0) { - semsg(_("E409: Unknown group name: %s"), p); + semsg(_(e_unknown_group_name_str), p); failed = TRUE; break; } @@ -6298,7 +6295,7 @@ ex_syntax(exarg_T *eap) { if (subcommands[i].name == NULL) { - semsg(_("E410: Invalid :syntax subcommand: %s"), subcmd_name); + semsg(_(e_invalid_syntax_subcommand_str), subcmd_name); break; } if (STRCMP(subcmd_name, (char_u *)subcommands[i].name) == 0) diff --git a/src/tag.c b/src/tag.c --- a/src/tag.c +++ b/src/tag.c @@ -510,7 +510,7 @@ do_tag( cur_match = MAXCOL - 1; else if (cur_match < 0) { - emsg(_("E425: Cannot go before first matching tag")); + emsg(_(e_cannot_go_before_first_matching_tag)); skip_msg = TRUE; cur_match = 0; cur_fnum = curbuf->b_fnum; @@ -665,7 +665,7 @@ do_tag( if (num_matches <= 0) { if (verbose) - semsg(_("E426: tag not found: %s"), name); + semsg(_(e_tag_not_found_str), name); #if defined(FEAT_QUICKFIX) g_do_tagpreview = 0; #endif @@ -732,9 +732,9 @@ do_tag( && nofile_fname == NULL) { if (num_matches == 1) - emsg(_("E427: There is only one matching tag")); + emsg(_(e_there_is_only_one_matching_tag)); else - emsg(_("E428: Cannot go beyond last matching tag")); + emsg(_(e_cannot_go_beyond_last_matching_tag)); skip_msg = TRUE; } cur_match = num_matches - 1; @@ -842,7 +842,7 @@ do_tag( } continue; } - semsg(_("E429: File \"%s\" does not exist"), nofile_fname); + semsg(_(e_file_str_does_not_exist), nofile_fname); } else { @@ -2166,7 +2166,7 @@ line_read_in: if (fp != NULL) { if (STRLEN(fullpath_ebuf) > LSIZE) - semsg(_("E430: Tag file path truncated for %s\n"), ebuf); + semsg(_(e_tag_file_path_truncated_for_str), ebuf); vim_strncpy(tag_fname, fullpath_ebuf, MAXPATHL); ++incstack_idx; @@ -2758,7 +2758,7 @@ parse_line: if (line_error) { - semsg(_("E431: Format error in tags file \"%s\""), tag_fname); + semsg(_(e_format_error_in_tags_file_str), tag_fname); #ifdef FEAT_CSCOPE if (!use_cscope) #endif @@ -2786,7 +2786,7 @@ parse_line: tag_file_sorted = NUL; if (sort_error) { - semsg(_("E432: Tags file not sorted: %s"), tag_fname); + semsg(_(e_tags_file_not_sorted_str), tag_fname); sort_error = FALSE; } #endif @@ -2830,7 +2830,7 @@ parse_line: if (!stop_searching) { if (!did_open && verbose) // never opened any tags file - emsg(_("E433: No tags file")); + emsg(_(e_no_tags_file)); retval = OK; // It's OK even when no tag found } @@ -3656,7 +3656,7 @@ jumpto_tag( } if (found == 0) { - emsg(_("E434: Can't find tag pattern")); + emsg(_(e_canot_find_tag_pattern)); curwin->w_cursor.lnum = save_lnum; } else @@ -3667,7 +3667,7 @@ jumpto_tag( */ if (found == 2 || !save_p_ic) { - msg(_("E435: Couldn't find tag, just guessing!")); + msg(_(e_couldnt_find_tag_just_guessing)); if (!msg_scrolled && msg_silent == 0) { out_flush(); diff --git a/src/term.c b/src/term.c --- a/src/term.c +++ b/src/term.c @@ -2384,7 +2384,7 @@ add_termcap_entry(char_u *name, int forc emsg(error_msg); else #endif - semsg(_("E436: No \"%s\" entry in termcap"), name); + semsg(_(e_no_str_entry_in_termcap), name); } return FAIL; } @@ -3161,7 +3161,7 @@ ttest(int pairs) * MUST have "cm": cursor motion. */ if (*T_CM == NUL) - emsg(_("E437: terminal capability \"cm\" required")); + emsg(_(e_terminal_capability_cm_required)); /* * if "cs" defined, use a scroll region, it's faster. diff --git a/src/typval.c b/src/typval.c --- a/src/typval.c +++ b/src/typval.c @@ -320,7 +320,7 @@ tv_get_float_chk(typval_T *varp, int *er emsg(_("E894: Using a Dictionary as a Float")); break; case VAR_BOOL: - emsg(_("E362: Using a boolean value as a Float")); + emsg(_(e_using_boolean_valud_as_float)); break; case VAR_SPECIAL: emsg(_("E907: Using a special value as a Float")); diff --git a/src/undo.c b/src/undo.c --- a/src/undo.c +++ b/src/undo.c @@ -2713,7 +2713,7 @@ u_undoredo(int undo) || bot > curbuf->b_ml.ml_line_count + 1) { unblock_autocmds(); - iemsg(_("E438: u_undo: line numbers wrong")); + iemsg(_(e_u_undo_line_numbers_wrong)); changed(); // don't want UNCHANGED now return; } @@ -3285,7 +3285,7 @@ u_get_headentry(void) { if (curbuf->b_u_newhead == NULL || curbuf->b_u_newhead->uh_entry == NULL) { - iemsg(_("E439: undo list corrupt")); + iemsg(_(e_undo_list_corrupt)); return NULL; } return curbuf->b_u_newhead->uh_entry; @@ -3317,7 +3317,7 @@ u_getbot(void) uep->ue_bot = uep->ue_top + uep->ue_size + 1 + extra; if (uep->ue_bot < 1 || uep->ue_bot > curbuf->b_ml.ml_line_count) { - iemsg(_("E440: undo line missing")); + iemsg(_(e_undo_line_missing)); uep->ue_bot = uep->ue_top + 1; // assume all lines deleted, will // get all the old lines back // without deleting the current 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 */ /**/ + 3985, +/**/ 3984, /**/ 3983, diff --git a/src/window.c b/src/window.c --- a/src/window.c +++ b/src/window.c @@ -260,7 +260,7 @@ newwindow: if (wp->w_p_pvw) break; if (wp == NULL) - emsg(_("E441: There is no preview window")); + emsg(_(e_there_is_no_preview_window)); else win_goto(wp); break; @@ -817,7 +817,7 @@ win_split(int size, int flags) flags |= cmdmod.cmod_split; if ((flags & WSP_TOP) && (flags & WSP_BOT)) { - emsg(_("E442: Can't split topleft and botright at the same time")); + emsg(_(e_cant_split_topleft_and_botright_at_the_same_time)); return FAIL; } @@ -1721,7 +1721,7 @@ win_rotate(int upwards, int count) FOR_ALL_FRAMES(frp, curwin->w_frame->fr_parent->fr_child) if (frp->fr_win == NULL) { - emsg(_("E443: Cannot rotate when another window is split")); + emsg(_(e_cannot_rotate_when_another_window_is_split)); return; } @@ -2487,7 +2487,7 @@ win_close(win_T *win, int free_buf) if (last_window()) { - emsg(_("E444: Cannot close last window")); + emsg(_(e_cannot_close_last_window)); return FAIL; } @@ -3663,7 +3663,7 @@ close_others( } if (message && !ONE_WINDOW) - emsg(_("E445: Other window contains changes")); + emsg(_(e_other_window_contains_changes)); } static void @@ -4485,7 +4485,7 @@ win_goto(win_T *wp) return; if (popup_is_popup(wp)) { - emsg(_("E366: Not allowed to enter a popup window")); + emsg(_(e_not_allowed_to_enter_popup_window)); return; } #endif