Mercurial > vim
comparison src/quickfix.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 | 7f150a4936f2 |
children | d91aea2a612c |
comparison
equal
deleted
inserted
replaced
26912:e6751c1e2a8e | 26913:d4e61d61afd9 |
---|---|
266 char_u *srcptr; | 266 char_u *srcptr; |
267 | 267 |
268 if (efminfo->addr[idx]) | 268 if (efminfo->addr[idx]) |
269 { | 269 { |
270 // Each errorformat pattern can occur only once | 270 // Each errorformat pattern can occur only once |
271 semsg(_("E372: Too many %%%c in format string"), *efmpat); | 271 semsg(_(e_too_many_chr_in_format_string), *efmpat); |
272 return NULL; | 272 return NULL; |
273 } | 273 } |
274 if ((idx && idx < 6 | 274 if ((idx && idx < 6 |
275 && vim_strchr((char_u *)"DXOPQ", efminfo->prefix) != NULL) | 275 && vim_strchr((char_u *)"DXOPQ", efminfo->prefix) != NULL) |
276 || (idx == 6 | 276 || (idx == 6 |
277 && vim_strchr((char_u *)"OPQ", efminfo->prefix) == NULL)) | 277 && vim_strchr((char_u *)"OPQ", efminfo->prefix) == NULL)) |
278 { | 278 { |
279 semsg(_("E373: Unexpected %%%c in format string"), *efmpat); | 279 semsg(_(e_unexpected_chr_in_format_str), *efmpat); |
280 return NULL; | 280 return NULL; |
281 } | 281 } |
282 efminfo->addr[idx] = (char_u)++round; | 282 efminfo->addr[idx] = (char_u)++round; |
283 *regpat++ = '\\'; | 283 *regpat++ = '\\'; |
284 *regpat++ = '('; | 284 *regpat++ = '('; |
349 while (efmp < efm + len | 349 while (efmp < efm + len |
350 && (*regpat++ = *++efmp) != ']') | 350 && (*regpat++ = *++efmp) != ']') |
351 // skip ; | 351 // skip ; |
352 if (efmp == efm + len) | 352 if (efmp == efm + len) |
353 { | 353 { |
354 emsg(_("E374: Missing ] in format string")); | 354 emsg(_(e_missing_rsb_in_format_string)); |
355 return NULL; | 355 return NULL; |
356 } | 356 } |
357 } | 357 } |
358 } | 358 } |
359 else if (efmp < efm + len) // %*\D, %*\s etc. | 359 else if (efmp < efm + len) // %*\D, %*\s etc. |
362 *regpat++ = '+'; | 362 *regpat++ = '+'; |
363 } | 363 } |
364 else | 364 else |
365 { | 365 { |
366 // TODO: scanf()-like: %*ud, %*3c, %*f, ... ? | 366 // TODO: scanf()-like: %*ud, %*3c, %*f, ... ? |
367 semsg(_("E375: Unsupported %%%c in format string"), *efmp); | 367 semsg(_(e_unsupported_chr_in_format_string), *efmp); |
368 return NULL; | 368 return NULL; |
369 } | 369 } |
370 | 370 |
371 *pefmp = efmp; | 371 *pefmp = efmp; |
372 | 372 |
383 efminfo->flags = *efmp++; | 383 efminfo->flags = *efmp++; |
384 if (vim_strchr((char_u *)"DXAEWINCZGOPQ", *efmp) != NULL) | 384 if (vim_strchr((char_u *)"DXAEWINCZGOPQ", *efmp) != NULL) |
385 efminfo->prefix = *efmp; | 385 efminfo->prefix = *efmp; |
386 else | 386 else |
387 { | 387 { |
388 semsg(_("E376: Invalid %%%c in format string prefix"), *efmp); | 388 semsg(_(e_invalid_chr_in_format_string_prefix), *efmp); |
389 return NULL; | 389 return NULL; |
390 } | 390 } |
391 | 391 |
392 return efmp; | 392 return efmp; |
393 } | 393 } |
450 if (efmp == NULL) | 450 if (efmp == NULL) |
451 return FAIL; | 451 return FAIL; |
452 } | 452 } |
453 else | 453 else |
454 { | 454 { |
455 semsg(_("E377: Invalid %%%c in format string"), *efmp); | 455 semsg(_(e_invalid_chr_in_format_string), *efmp); |
456 return FAIL; | 456 return FAIL; |
457 } | 457 } |
458 } | 458 } |
459 else // copy normal character | 459 else // copy normal character |
460 { | 460 { |
571 // Advance to next part | 571 // Advance to next part |
572 efm = skip_to_option_part(efm + len); // skip comma and spaces | 572 efm = skip_to_option_part(efm + len); // skip comma and spaces |
573 } | 573 } |
574 | 574 |
575 if (fmt_first == NULL) // nothing found | 575 if (fmt_first == NULL) // nothing found |
576 emsg(_("E378: 'errorformat' contains no pattern")); | 576 emsg(_(e_errorformat_contains_no_pattern)); |
577 | 577 |
578 goto parse_efm_end; | 578 goto parse_efm_end; |
579 | 579 |
580 parse_efm_error: | 580 parse_efm_error: |
581 free_efm_list(&fmt_first); | 581 free_efm_list(&fmt_first); |
1271 { | 1271 { |
1272 if (idx == 'D') // enter directory | 1272 if (idx == 'D') // enter directory |
1273 { | 1273 { |
1274 if (*fields->namebuf == NUL) | 1274 if (*fields->namebuf == NUL) |
1275 { | 1275 { |
1276 emsg(_("E379: Missing or empty directory name")); | 1276 emsg(_(e_missing_or_empty_directory_name)); |
1277 return QF_FAIL; | 1277 return QF_FAIL; |
1278 } | 1278 } |
1279 qfl->qf_directory = | 1279 qfl->qf_directory = |
1280 qf_push_dir(fields->namebuf, &qfl->qf_dir_stack, FALSE); | 1280 qf_push_dir(fields->namebuf, &qfl->qf_dir_stack, FALSE); |
1281 if (qfl->qf_directory == NULL) | 1281 if (qfl->qf_directory == NULL) |
3785 { | 3785 { |
3786 if (eap->cmdidx == CMD_colder || eap->cmdidx == CMD_lolder) | 3786 if (eap->cmdidx == CMD_colder || eap->cmdidx == CMD_lolder) |
3787 { | 3787 { |
3788 if (qi->qf_curlist == 0) | 3788 if (qi->qf_curlist == 0) |
3789 { | 3789 { |
3790 emsg(_("E380: At bottom of quickfix stack")); | 3790 emsg(_(e_at_bottom_of_quickfix_stack)); |
3791 break; | 3791 break; |
3792 } | 3792 } |
3793 --qi->qf_curlist; | 3793 --qi->qf_curlist; |
3794 } | 3794 } |
3795 else | 3795 else |
3796 { | 3796 { |
3797 if (qi->qf_curlist >= qi->qf_listcount - 1) | 3797 if (qi->qf_curlist >= qi->qf_listcount - 1) |
3798 { | 3798 { |
3799 emsg(_("E381: At top of quickfix stack")); | 3799 emsg(_(e_at_top_of_quickfix_stack)); |
3800 break; | 3800 break; |
3801 } | 3801 } |
3802 ++qi->qf_curlist; | 3802 ++qi->qf_curlist; |
3803 } | 3803 } |
3804 } | 3804 } |