Mercurial > vim
comparison src/tag.c @ 26913:d4e61d61afd9 v8.2.3985
patch 8.2.3985: error messages are spread out
Commit: https://github.com/vim/vim/commit/ac78dd4a352196ca4e6640f8e4caaf126afd49e3
Author: Bram Moolenaar <Bram@vim.org>
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 02 Jan 2022 20:30:04 +0100 |
parents | 06a137af96f8 |
children | d91aea2a612c |
comparison
equal
deleted
inserted
replaced
26912:e6751c1e2a8e | 26913:d4e61d61afd9 |
---|---|
508 } | 508 } |
509 if (cur_match >= MAXCOL) | 509 if (cur_match >= MAXCOL) |
510 cur_match = MAXCOL - 1; | 510 cur_match = MAXCOL - 1; |
511 else if (cur_match < 0) | 511 else if (cur_match < 0) |
512 { | 512 { |
513 emsg(_("E425: Cannot go before first matching tag")); | 513 emsg(_(e_cannot_go_before_first_matching_tag)); |
514 skip_msg = TRUE; | 514 skip_msg = TRUE; |
515 cur_match = 0; | 515 cur_match = 0; |
516 cur_fnum = curbuf->b_fnum; | 516 cur_fnum = curbuf->b_fnum; |
517 } | 517 } |
518 } | 518 } |
663 } | 663 } |
664 | 664 |
665 if (num_matches <= 0) | 665 if (num_matches <= 0) |
666 { | 666 { |
667 if (verbose) | 667 if (verbose) |
668 semsg(_("E426: tag not found: %s"), name); | 668 semsg(_(e_tag_not_found_str), name); |
669 #if defined(FEAT_QUICKFIX) | 669 #if defined(FEAT_QUICKFIX) |
670 g_do_tagpreview = 0; | 670 g_do_tagpreview = 0; |
671 #endif | 671 #endif |
672 } | 672 } |
673 else | 673 else |
730 // There will be an emsg("file doesn't exist") below then. | 730 // There will be an emsg("file doesn't exist") below then. |
731 if ((type == DT_NEXT || type == DT_FIRST) | 731 if ((type == DT_NEXT || type == DT_FIRST) |
732 && nofile_fname == NULL) | 732 && nofile_fname == NULL) |
733 { | 733 { |
734 if (num_matches == 1) | 734 if (num_matches == 1) |
735 emsg(_("E427: There is only one matching tag")); | 735 emsg(_(e_there_is_only_one_matching_tag)); |
736 else | 736 else |
737 emsg(_("E428: Cannot go beyond last matching tag")); | 737 emsg(_(e_cannot_go_beyond_last_matching_tag)); |
738 skip_msg = TRUE; | 738 skip_msg = TRUE; |
739 } | 739 } |
740 cur_match = num_matches - 1; | 740 cur_match = num_matches - 1; |
741 } | 741 } |
742 if (use_tagstack) | 742 if (use_tagstack) |
840 type = DT_NEXT; | 840 type = DT_NEXT; |
841 ++cur_match; | 841 ++cur_match; |
842 } | 842 } |
843 continue; | 843 continue; |
844 } | 844 } |
845 semsg(_("E429: File \"%s\" does not exist"), nofile_fname); | 845 semsg(_(e_file_str_does_not_exist), nofile_fname); |
846 } | 846 } |
847 else | 847 else |
848 { | 848 { |
849 // We may have jumped to another window, check that | 849 // We may have jumped to another window, check that |
850 // tagstackidx is still valid. | 850 // tagstackidx is still valid. |
2164 { | 2164 { |
2165 fp = mch_fopen((char *)fullpath_ebuf, "r"); | 2165 fp = mch_fopen((char *)fullpath_ebuf, "r"); |
2166 if (fp != NULL) | 2166 if (fp != NULL) |
2167 { | 2167 { |
2168 if (STRLEN(fullpath_ebuf) > LSIZE) | 2168 if (STRLEN(fullpath_ebuf) > LSIZE) |
2169 semsg(_("E430: Tag file path truncated for %s\n"), ebuf); | 2169 semsg(_(e_tag_file_path_truncated_for_str), ebuf); |
2170 vim_strncpy(tag_fname, fullpath_ebuf, | 2170 vim_strncpy(tag_fname, fullpath_ebuf, |
2171 MAXPATHL); | 2171 MAXPATHL); |
2172 ++incstack_idx; | 2172 ++incstack_idx; |
2173 is_etag = 0; // we can include anything | 2173 is_etag = 0; // we can include anything |
2174 } | 2174 } |
2756 #endif | 2756 #endif |
2757 } // forever | 2757 } // forever |
2758 | 2758 |
2759 if (line_error) | 2759 if (line_error) |
2760 { | 2760 { |
2761 semsg(_("E431: Format error in tags file \"%s\""), tag_fname); | 2761 semsg(_(e_format_error_in_tags_file_str), tag_fname); |
2762 #ifdef FEAT_CSCOPE | 2762 #ifdef FEAT_CSCOPE |
2763 if (!use_cscope) | 2763 if (!use_cscope) |
2764 #endif | 2764 #endif |
2765 semsg(_("Before byte %ld"), (long)vim_ftell(fp)); | 2765 semsg(_("Before byte %ld"), (long)vim_ftell(fp)); |
2766 stop_searching = TRUE; | 2766 stop_searching = TRUE; |
2784 | 2784 |
2785 #ifdef FEAT_TAG_BINS | 2785 #ifdef FEAT_TAG_BINS |
2786 tag_file_sorted = NUL; | 2786 tag_file_sorted = NUL; |
2787 if (sort_error) | 2787 if (sort_error) |
2788 { | 2788 { |
2789 semsg(_("E432: Tags file not sorted: %s"), tag_fname); | 2789 semsg(_(e_tags_file_not_sorted_str), tag_fname); |
2790 sort_error = FALSE; | 2790 sort_error = FALSE; |
2791 } | 2791 } |
2792 #endif | 2792 #endif |
2793 | 2793 |
2794 /* | 2794 /* |
2828 #endif | 2828 #endif |
2829 | 2829 |
2830 if (!stop_searching) | 2830 if (!stop_searching) |
2831 { | 2831 { |
2832 if (!did_open && verbose) // never opened any tags file | 2832 if (!did_open && verbose) // never opened any tags file |
2833 emsg(_("E433: No tags file")); | 2833 emsg(_(e_no_tags_file)); |
2834 retval = OK; // It's OK even when no tag found | 2834 retval = OK; // It's OK even when no tag found |
2835 } | 2835 } |
2836 | 2836 |
2837 findtag_end: | 2837 findtag_end: |
2838 vim_free(lbuf); | 2838 vim_free(lbuf); |
3654 } | 3654 } |
3655 *tagp.tagname_end = cc; | 3655 *tagp.tagname_end = cc; |
3656 } | 3656 } |
3657 if (found == 0) | 3657 if (found == 0) |
3658 { | 3658 { |
3659 emsg(_("E434: Can't find tag pattern")); | 3659 emsg(_(e_canot_find_tag_pattern)); |
3660 curwin->w_cursor.lnum = save_lnum; | 3660 curwin->w_cursor.lnum = save_lnum; |
3661 } | 3661 } |
3662 else | 3662 else |
3663 { | 3663 { |
3664 /* | 3664 /* |
3665 * Only give a message when really guessed, not when 'ic' | 3665 * Only give a message when really guessed, not when 'ic' |
3666 * is set and match found while ignoring case. | 3666 * is set and match found while ignoring case. |
3667 */ | 3667 */ |
3668 if (found == 2 || !save_p_ic) | 3668 if (found == 2 || !save_p_ic) |
3669 { | 3669 { |
3670 msg(_("E435: Couldn't find tag, just guessing!")); | 3670 msg(_(e_couldnt_find_tag_just_guessing)); |
3671 if (!msg_scrolled && msg_silent == 0) | 3671 if (!msg_scrolled && msg_silent == 0) |
3672 { | 3672 { |
3673 out_flush(); | 3673 out_flush(); |
3674 ui_delay(1010L, TRUE); | 3674 ui_delay(1010L, TRUE); |
3675 } | 3675 } |