aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-16 06:56:12 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-02-16 07:18:06 +0800
commit163add40b8b98b91dfb8eff589f49dc75f1032ea (patch)
treec6502c68406be5ae3ef88e292f81cff9f9d71ac2 /src/nvim/fileio.c
parentc1fa8789c1ba5549dc37163dfa9be039c5092a41 (diff)
downloadrneovim-163add40b8b98b91dfb8eff589f49dc75f1032ea.tar.gz
rneovim-163add40b8b98b91dfb8eff589f49dc75f1032ea.tar.bz2
rneovim-163add40b8b98b91dfb8eff589f49dc75f1032ea.zip
vim-patch:9.1.0113: duplicate code when cleaning undo stack
Problem: duplicate code when cleaning undo stack Solution: refactor undo cleanup into a single public function related: vim/vim#13928 https://github.com/vim/vim/commit/9071ed8107244e0c56a16b77d1c28e975cb21dd2 Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index a06a773f47..2c96e4bd87 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -3171,8 +3171,7 @@ void buf_reload(buf_T *buf, int orig_mode, bool 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);