summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:40:16 +0000
commit6af24b2457752c0d36aaf9f29f03d39afd09937f (patch)
tree2671b594908d1f971de6b2a2d473f97dfb7291d2 /src/fileio.c
parentReleasing progress-linux version 2:9.1.0016-1~progress7.99u1. (diff)
downloadvim-6af24b2457752c0d36aaf9f29f03d39afd09937f.tar.xz
vim-6af24b2457752c0d36aaf9f29f03d39afd09937f.zip
Merging upstream version 2:9.1.0199.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 180fe39..53bfbea 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1246,7 +1246,7 @@ retry:
for (;;)
{
p = ml_get(read_buf_lnum) + read_buf_col;
- n = (int)STRLEN(p);
+ n = ml_get_len(read_buf_lnum) - read_buf_col;
if ((int)tlen + n + 1 > size)
{
// Filled up to "size", append partial line.
@@ -4489,8 +4489,14 @@ buf_reload(buf_T *buf, int orig_mode, int reload_options)
if (saved == OK)
{
+ int old_msg_silent = msg_silent;
+
curbuf->b_flags |= BF_CHECK_RO; // check for RO again
keep_filetype = TRUE; // don't detect 'filetype'
+
+ if (shortmess(SHM_FILEINFO))
+ msg_silent = 1;
+
if (readfile(buf->b_ffname, buf->b_fname, (linenr_T)0,
(linenr_T)0,
(linenr_T)MAXLNUM, &ea, flags) != OK)
@@ -4514,16 +4520,15 @@ buf_reload(buf_T *buf, int orig_mode, int reload_options)
// Mark the buffer as unmodified and free undo info.
unchanged(buf, TRUE, TRUE);
if ((flags & READ_KEEP_UNDO) == 0)
- {
- u_blockfree(buf);
- u_clearall(buf);
- }
+ u_clearallandblockfree(buf);
else
{
// Mark all undo states as changed.
u_unchanged(curbuf);
}
}
+
+ msg_silent = old_msg_silent;
}
vim_free(ea.cmd);