mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 00:30:25 +02:00
First commit
If any of the commands are cancels, an entry for the macro remains in history.
This commit is contained in:
parent
4f129ae0af
commit
d966303558
@ -966,18 +966,15 @@ bool MacroCommands::ApplyMacro(
|
||||
if (proj) {
|
||||
ProjectHistory::Get(*proj).PushState(longDesc, shortDesc);
|
||||
}
|
||||
}
|
||||
|
||||
// Upon exit of the top level apply, roll back the state if
|
||||
// an error occurs.
|
||||
// Upon exit of the top level apply, roll back the state if an error occurs.
|
||||
auto cleanup2 = finally([&] {
|
||||
if (!res) {
|
||||
if (proj) {
|
||||
if (MacroReentryCount == 1 && !res && proj) {
|
||||
// Macro failed or was cancelled; revert to the previous state
|
||||
ProjectHistory::Get(*proj).RollbackState();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
mAbort = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user