diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-16 22:57:34 +0200 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2021-07-06 19:07:11 +0200 |
commit | 55a2c513aafb386c01259fca711b2e0f9b85e359 (patch) | |
tree | e9775da5a45147c4706ad468af925e0a53bcdcb3 /src/nvim/fileio.c | |
parent | df33f30e8882b2bf692253d63f73fb602a13f888 (diff) | |
download | rneovim-55a2c513aafb386c01259fca711b2e0f9b85e359.tar.gz rneovim-55a2c513aafb386c01259fca711b2e0f9b85e359.tar.bz2 rneovim-55a2c513aafb386c01259fca711b2e0f9b85e359.zip |
buffer: don't rely on curbuf in BUFEMPTY
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 29c29a2884..645423eafe 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5027,7 +5027,7 @@ void buf_reload(buf_T *buf, int orig_mode) // buffer contents. But if reading the file fails we should keep // the old contents. Can't use memory only, the file might be // too big. Use a hidden buffer to move the buffer contents to. - if (BUFEMPTY() || saved == FAIL) { + if (BUFEMPTY(curbuf) || saved == FAIL) { savebuf = NULL; } else { // Allocate a buffer without putting it in the buffer list. @@ -5060,7 +5060,7 @@ void buf_reload(buf_T *buf, int orig_mode) if (savebuf != NULL && bufref_valid(&bufref) && buf == curbuf) { // Put the text back from the save buffer. First // delete any lines that readfile() added. - while (!BUFEMPTY()) { + while (!BUFEMPTY(curbuf)) { if (ml_delete(buf->b_ml.ml_line_count, false) == FAIL) { break; } |