aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-16 07:34:02 +0800
committerGitHub <noreply@github.com>2024-02-16 07:34:02 +0800
commit04dfa2eea914086a9f42a5a00a33e9524f9fded4 (patch)
treec6502c68406be5ae3ef88e292f81cff9f9d71ac2 /src/nvim/buffer.c
parentd60eeacae4ce4aa780636b90199ac20af609e91b (diff)
parent163add40b8b98b91dfb8eff589f49dc75f1032ea (diff)
downloadrneovim-04dfa2eea914086a9f42a5a00a33e9524f9fded4.tar.gz
rneovim-04dfa2eea914086a9f42a5a00a33e9524f9fded4.tar.bz2
rneovim-04dfa2eea914086a9f42a5a00a33e9524f9fded4.zip
Merge pull request #27485 from zeertzjq/vim-9.1.0112
vim-patch:9.1.{0112,0113}
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 38c3ee13aa..bf1d2ac6dd 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -843,8 +843,9 @@ void buf_freeall(buf_T *buf, int flags)
ml_close(buf, true); // close and delete the memline/memfile
buf->b_ml.ml_line_count = 0; // no lines in buffer
if ((flags & BFA_KEEP_UNDO) == 0) {
- u_blockfree(buf); // free the memory allocated for undo
- u_clearall(buf); // reset all undo information
+ // free the memory allocated for undo
+ // and reset all undo information
+ u_clearallandblockfree(buf);
}
syntax_clear(&buf->b_s); // reset syntax info
buf->b_flags &= ~BF_READERR; // a read error is no longer relevant