I have noticed that in long editing sessions, calling undo-tree (C-x C-u) becomes slower and slower. I presume that the reason is that as the tree grows bigger it takes longer to parse it (as it keeps track of all my edits since I opened the file)
Is there any way to clear up the tree of undos on an open file? I have tried C-x C-v (find-alternate-file), but this re-opens the file which resets the cursor (and in modes like org-mode collapses my lists)
Reset the
buffer-undo-treevariable usingM-: (setq buffer-undo-tree nil). This discards the entire undo history of the buffer, as recorded byundo-tree.el.This can also be made into a command and bound to a key with code like this: