Overwriting selected text breaks undo functionality
I've been using Gnome Text Editor to work on LaTeX documents recently. It's a great app for this purpose, but I noticed that sometimes the undo functionality doesn't seem to work as expected. It was hard to track down the issue, but I think I've found a way to reproduce it:
- Create a new document.
- Type (or paste) a sentence, e.g.,
This is a first sentence.
- Select the entire text (or parts of it) and type ahead to replace it with something different, e.g.,
This is an improved version of the first sentence
. - Press
Ctrl + Z
to undo the recent changes. The document will immediately be reverted to step 2 instead of providing intermediate undo steps. Even if the text in step 3 is very long, the individual changes are not part of the undo stack. - Press
Ctrl + Y
to redo the changes, as step 4 did not work as expected. The document will be reverted to step 3. From now on the undo functionality is utterly broken. When adding additional text to the document, these changes will not be part of the undo stack. When Using the undo functionality, the document is always reverted to step 2.
Apparently, I often select parts of my texts and rewrite them, which frequently triggers the described issue. As a result, it is very likely to lose unsaved changes to the document.
I am using version 41.0 of the app, packaged as a Flatpak and installed from flathub.org.
Edited by Michael Rapp