Skip to content

Commit 615effe

Browse files
committed
PythonInterpreter: don't add submitted command to history until it has been successfuly submitted (also stip trailing endline)
1 parent bb0fe65 commit 615effe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎PythonInterpreter/PythonInterpCtrl.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,6 @@ bool PythonInterpCtrl::DispatchCode(const wxString &code)
449449
if(m_pyinterp->IsJobRunning())
450450
return false;
451451
m_code=code;
452-
m_codectrl->m_history_commands.Add(code);
453-
m_codectrl->m_history_position = -1;
454452
// if (RunCode(wxString(code.c_str())))
455453
if (RunCode(wxString(code)))
456454
{
@@ -484,6 +482,8 @@ void PythonInterpCtrl::OnPyNotify(XmlRpcResponseEvent& event)
484482
m_ioctrl->AppendText(m_code);
485483
m_ioctrl->SetDefaultStyle(oldta);
486484
// m_ioctrl->AppendText(_T("\n"));
485+
m_codectrl->m_history_commands.Add(m_code.BeforeLast(_T('\n')));
486+
m_codectrl->m_history_position = -1;
487487
m_code = wxEmptyString;
488488
}
489489

0 commit comments

Comments
 (0)