patch 8.2.3977: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
diff --git a/src/memfile.c b/src/memfile.c
index fbffdbe..4e8decb 100644
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -477,7 +477,7 @@
flags = hp->bh_flags;
if ((flags & BH_LOCKED) == 0)
- iemsg(_("E293: block was not locked"));
+ iemsg(_(e_block_was_not_locked));
flags &= ~BH_LOCKED;
if (dirty)
{
@@ -945,12 +945,12 @@
size = page_size * hp->bh_page_count;
if (vim_lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
{
- PERROR(_("E294: Seek error in swap file read"));
+ PERROR(_(e_seek_error_in_swap_file_read));
return FAIL;
}
if ((unsigned)read_eintr(mfp->mf_fd, hp->bh_data, size) != size)
{
- PERROR(_("E295: Read error in swap file"));
+ PERROR(_(e_read_error_in_swap_file));
return FAIL;
}
@@ -1021,7 +1021,7 @@
{
if (vim_lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
{
- PERROR(_("E296: Seek error in swap file write"));
+ PERROR(_(e_seek_error_in_swap_file_write));
return FAIL;
}
if (mf_write_block(mfp,
@@ -1046,7 +1046,7 @@
// successful write or when hitting a key. We keep on trying,
// in case some space becomes available.
if (!did_swapwrite_msg)
- emsg(_("E297: Write error in swap file"));
+ emsg(_(e_write_error_in_swap_file));
did_swapwrite_msg = TRUE;
return FAIL;
}