comparison src/spellfile.c @ 26877:06a137af96f8 v8.2.3967

patch 8.2.3967: error messages are spread out Commit: https://github.com/vim/vim/commit/460ae5dfca31fa627531c263184849976755cf6b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 1 14:19:49 2022 +0000 patch 8.2.3967: error messages are spread out Problem: Error messages are spread out. Solution: Move more errors to errors.h.
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Jan 2022 15:30:05 +0100
parents bce848ec8b1b
children 7f150a4936f2
comparison
equal deleted inserted replaced
26876:601a973ac16c 26877:06a137af96f8
363 363
364 fd = mch_fopen((char *)fname, "r"); 364 fd = mch_fopen((char *)fname, "r");
365 if (fd == NULL) 365 if (fd == NULL)
366 { 366 {
367 if (!silent) 367 if (!silent)
368 semsg(_(e_notopen), fname); 368 semsg(_(e_cant_open_file_str), fname);
369 else if (p_verbose > 2) 369 else if (p_verbose > 2)
370 { 370 {
371 verbose_enter(); 371 verbose_enter();
372 smsg((const char *)e_notopen, fname); 372 smsg((const char *)e_cant_open_file_str, fname);
373 verbose_leave(); 373 verbose_leave();
374 } 374 }
375 goto endFAIL; 375 goto endFAIL;
376 } 376 }
377 if (p_verbose > 2) 377 if (p_verbose > 2)
2224 * Open the file. 2224 * Open the file.
2225 */ 2225 */
2226 fd = mch_fopen((char *)fname, "r"); 2226 fd = mch_fopen((char *)fname, "r");
2227 if (fd == NULL) 2227 if (fd == NULL)
2228 { 2228 {
2229 semsg(_(e_notopen), fname); 2229 semsg(_(e_cant_open_file_str), fname);
2230 return NULL; 2230 return NULL;
2231 } 2231 }
2232 2232
2233 vim_snprintf((char *)IObuff, IOSIZE, _("Reading affix file %s..."), fname); 2233 vim_snprintf((char *)IObuff, IOSIZE, _("Reading affix file %s..."), fname);
2234 spell_message(spin, IObuff); 2234 spell_message(spin, IObuff);
3518 * Open the file. 3518 * Open the file.
3519 */ 3519 */
3520 fd = mch_fopen((char *)fname, "r"); 3520 fd = mch_fopen((char *)fname, "r");
3521 if (fd == NULL) 3521 if (fd == NULL)
3522 { 3522 {
3523 semsg(_(e_notopen), fname); 3523 semsg(_(e_cant_open_file_str), fname);
3524 return FAIL; 3524 return FAIL;
3525 } 3525 }
3526 3526
3527 // The hashtable is only used to detect duplicated words. 3527 // The hashtable is only used to detect duplicated words.
3528 hash_init(&ht); 3528 hash_init(&ht);
4102 * Open the file. 4102 * Open the file.
4103 */ 4103 */
4104 fd = mch_fopen((char *)fname, "r"); 4104 fd = mch_fopen((char *)fname, "r");
4105 if (fd == NULL) 4105 if (fd == NULL)
4106 { 4106 {
4107 semsg(_(e_notopen), fname); 4107 semsg(_(e_cant_open_file_str), fname);
4108 return FAIL; 4108 return FAIL;
4109 } 4109 }
4110 4110
4111 vim_snprintf((char *)IObuff, IOSIZE, _("Reading word file %s..."), fname); 4111 vim_snprintf((char *)IObuff, IOSIZE, _("Reading word file %s..."), fname);
4112 spell_message(spin, IObuff); 4112 spell_message(spin, IObuff);
4871 // warnings from picky compiler 4871 // warnings from picky compiler
4872 4872
4873 fd = mch_fopen((char *)fname, "w"); 4873 fd = mch_fopen((char *)fname, "w");
4874 if (fd == NULL) 4874 if (fd == NULL)
4875 { 4875 {
4876 semsg(_(e_notopen), fname); 4876 semsg(_(e_cant_open_file_str), fname);
4877 return FAIL; 4877 return FAIL;
4878 } 4878 }
4879 4879
4880 // <HEADER>: <fileID> <versionnr> 4880 // <HEADER>: <fileID> <versionnr>
4881 // <fileID> 4881 // <fileID>
5800 5800
5801 // Create the file. Note that an existing file is silently overwritten! 5801 // Create the file. Note that an existing file is silently overwritten!
5802 fd = mch_fopen((char *)fname, "w"); 5802 fd = mch_fopen((char *)fname, "w");
5803 if (fd == NULL) 5803 if (fd == NULL)
5804 { 5804 {
5805 semsg(_(e_notopen), fname); 5805 semsg(_(e_cant_open_file_str), fname);
5806 return; 5806 return;
5807 } 5807 }
5808 5808
5809 vim_snprintf((char *)IObuff, IOSIZE, 5809 vim_snprintf((char *)IObuff, IOSIZE,
5810 _("Writing suggestion file %s..."), fname); 5810 _("Writing suggestion file %s..."), fname);
6314 fd = mch_fopen((char *)fname, "a"); 6314 fd = mch_fopen((char *)fname, "a");
6315 } 6315 }
6316 } 6316 }
6317 6317
6318 if (fd == NULL) 6318 if (fd == NULL)
6319 semsg(_(e_notopen), fname); 6319 semsg(_(e_cant_open_file_str), fname);
6320 else 6320 else
6321 { 6321 {
6322 if (what == SPELL_ADD_BAD) 6322 if (what == SPELL_ADD_BAD)
6323 fprintf(fd, "%.*s/!\n", len, word); 6323 fprintf(fd, "%.*s/!\n", len, word);
6324 else if (what == SPELL_ADD_RARE) 6324 else if (what == SPELL_ADD_RARE)