Skip to content

Commit

Permalink
#5629: Wrap script command execution in a scoped UndoableCommand, to …
Browse files Browse the repository at this point in the history
…make the changes undoable.
  • Loading branch information
codereader committed Jun 9, 2021
1 parent a3ac032 commit b45b1cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/script/ScriptingSystem.cpp
Expand Up @@ -10,6 +10,7 @@
#include "ieventmanager.h"
#include "imainframe.h"
#include "igroupdialog.h"
#include "iundo.h"

#include "interfaces/MathInterface.h"
#include "interfaces/RegistryInterface.h"
Expand Down Expand Up @@ -133,15 +134,13 @@ void ScriptingSystem::initialise()

void ScriptingSystem::runScriptFile(const cmd::ArgumentList& args)
{
// Start the test script
if (args.empty()) return;

executeScriptFile(args[0].getString());
}

void ScriptingSystem::runScriptCommand(const cmd::ArgumentList& args)
{
// Start the test script
if (args.empty()) return;

executeCommand(args[0].getString());
Expand Down Expand Up @@ -171,6 +170,8 @@ void ScriptingSystem::executeCommand(const std::string& name)
return;
}

UndoableCommand cmd("runScriptCommand " + name);

// Execute the script file behind this command
executeScriptFile(found->second->getFilename(), true);
}
Expand Down

0 comments on commit b45b1cc

Please sign in to comment.