summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
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);