mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
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
9071ed8107
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user