diff options
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 2c96e4bd87..f032604a59 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -957,7 +957,7 @@ retry: int tlen = 0; while (true) { p = (uint8_t *)ml_get(read_buf_lnum) + read_buf_col; - int n = (int)strlen((char *)p); + int n = ml_get_len(read_buf_lnum) - read_buf_col; if (tlen + n + 1 > size) { // Filled up to "size", append partial line. // Change NL to NUL to reverse the effect done @@ -2629,7 +2629,7 @@ static int rename_with_tmp(const char *const from, const char *const to) STRCPY(tempname, from); for (int n = 123; n < 99999; n++) { char *tail = path_tail(tempname); - snprintf(tail, (size_t)((MAXPATHL + 1) - (tail - tempname - 1)), "%d", n); + snprintf(tail, (size_t)((MAXPATHL + 1) - (tail - tempname)), "%d", n); if (!os_path_exists(tempname)) { if (os_rename(from, tempname) == OK) { @@ -3153,7 +3153,7 @@ void buf_reload(buf_T *buf, int orig_mode, bool reload_options) curbuf->b_flags |= BF_CHECK_RO; // check for RO again keep_filetype = true; // don't detect 'filetype' if (readfile(buf->b_ffname, buf->b_fname, 0, 0, - (linenr_T)MAXLNUM, &ea, flags, false) != OK) { + (linenr_T)MAXLNUM, &ea, flags, shortmess(SHM_FILEINFO)) != OK) { if (!aborting()) { semsg(_("E321: Could not reload \"%s\""), buf->b_fname); } @@ -3197,7 +3197,7 @@ void buf_reload(buf_T *buf, int orig_mode, bool reload_options) curwin->w_topline = old_topline; } curwin->w_cursor = old_cursor; - check_cursor(); + check_cursor(curwin); update_topline(curwin); keep_filetype = false; |