mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 14:02:57 +02:00
Fix \n shenanigans in command output.
This commit is contained in:
committed by
Paul Licameli
parent
65c160212e
commit
510f68e9ad
@@ -149,7 +149,8 @@ bool ApplyAndSendResponse::Apply()
|
||||
bool bResult = mCommand->Apply(*( mCtx.get()));
|
||||
return bResult; }
|
||||
);
|
||||
wxString response = GetName();
|
||||
wxString response = wxT( "\n" );
|
||||
response += GetName();
|
||||
// These three strings are deliberately not localised.
|
||||
// They are used in script responses and always happen in English.
|
||||
response += wxT(" finished: ");
|
||||
|
@@ -218,17 +218,25 @@ class ResponseQueueTarget final : public CommandMessageTarget
|
||||
{
|
||||
private:
|
||||
ResponseQueue &mResponseQueue;
|
||||
wxString mBuffer;
|
||||
public:
|
||||
ResponseQueueTarget(ResponseQueue &responseQueue)
|
||||
: mResponseQueue(responseQueue)
|
||||
: mResponseQueue(responseQueue),
|
||||
mBuffer( wxEmptyString )
|
||||
{ }
|
||||
virtual ~ResponseQueueTarget()
|
||||
{
|
||||
if( mBuffer.StartsWith("\n" ) )
|
||||
mBuffer = mBuffer.Mid( 1 );
|
||||
mResponseQueue.AddResponse( mBuffer );
|
||||
mResponseQueue.AddResponse(wxString(wxT("\n")));
|
||||
}
|
||||
void Update(const wxString &message) override
|
||||
{
|
||||
mResponseQueue.AddResponse(message);
|
||||
mBuffer += message;
|
||||
#if 0
|
||||
mResponseQueue.AddResponse(message);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user