After finishing work the function ScriptingManager::LoadBufferRedirectOutput
will redirect the print output always to the internal ScriptsPrintFunc
function. This is wrong, because for example the scripting console redirects the output to itself if it is open.
You can see the behavior if you safe this scrip in a file and run it in the script console:
print(_("You see me in the script console"));
Log(ReplaceMacros(_("[[print(_(\"I will break printing in the script console\"))]])))
print(_("You will NOT see me in the script console"));
The attached patch will fix this by restoring the old print function.
If no comments are made i will commit this tomorrow.
This is also one bug i need to be fixed to can write tests for ticket 520
Why are you calling SquirrelVM::GetVMPtr() multiple times? Call it once and use a variable. Other than that I cannot comment if it is good or bad... So go on and lets see what will break if it breaks. :)
Commited in revision: 11658