I use undo-tree mode in my emacs setup. Every once in a while, after writing a lot of text, I accidentally undo changes while I have some region selected. I am not 100% sure what undo-tree is doing and this is not 100% reproducible but there is high chance that this completely messes up my text. If I visualize the undo-tree I see a linear path but I cannot go up the tree even a single node (emacs just hangs).
Any idea why this is happening? I suspect that undo-tree is trying to undo the changes in the selected text as opposed to the whole buffer. If that's the case, can I disable this behavior?