Skip to content

Commit 63ce071

Browse files
committed
Lock undo stack between plugin commands
1 parent 0466e0c commit 63ce071

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/engraving/api/v1/score.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ void Score::startCmd(const QString& qActionName)
248248
: TranslatableString::untranslatable(qActionName);
249249

250250
undoStack()->prepareChanges(actionName);
251+
// Lock the undo stack, so that all changes made by the plugin,
252+
// including PluginAPI::cmd(), are committed as a single command.
253+
undoStack()->lock();
251254
}
252255

253256
void Score::endCmd(bool rollback)
@@ -256,6 +259,8 @@ void Score::endCmd(bool rollback)
256259
return;
257260
}
258261

262+
undoStack()->unlock();
263+
259264
if (rollback) {
260265
undoStack()->rollbackChanges();
261266
} else {

0 commit comments

Comments
 (0)