Deleting all text in edit mode breaks Undo

• Feb 16, 2021 - 15:34
Reported version
3.6
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project
  1. Open any score that contains text elements (e.g. the attached).
  2. Double-click on the text to edit it, and delete everything inside it (Ctrl+A, Del)
  3. Confirm by leaving text edit mode (Esc).
  4. Undo (Ctrl+Z) to try to restore the text deleted in step 2.

Result: Nothing seems to happen. The text element gets selected and still exists, but remains empty (and invisible). The deleted content is lost and cannot be restored with Undo.

OS: Manjaro Linux, Arch.: x86_64, MuseScore version (64-bit): 3.6.2.548021370, revision: 3224f34


  • Other actions performed before or after deleting the text are not affected and can still be un/re-done.
    This includes changes to the content of the very same element!
  • All text elements I have tried are affected.
    • For lyrics and chord symbols, it does not seem to matter how I confirm my edit (leaving edit mode Esc, or jumping to another element with e.g. Space).
    • EDIT: Text frames are not affected (Undo works as expected); but text added to vertical or horizontal frames is affected.
  • Undo works as expected if the text is instead replaced by any non-empty text before confirming (including entirely whitespace), or if the whole element is deleted outside of edit mode.
Attachment Size
literally_just_staff_text.mscz 2.51 KB

Comments

Status PR created fixed

Fixed in branch 3.x, commit 1bc5ac1e27

_Fix #317631: Deleting all text in edit mode breaks Undo

Resolves: https://musescore.org/en/node/317631.

If all text is deleted from a text element, the element itself is deleted. In order for undo to restore the text that was deleted, we must reset the element's text to what it was before editing, just prior to removing the element._