diff --git a/Source/PythonConsole/Private/SPythonLog.cpp b/Source/PythonConsole/Private/SPythonLog.cpp index 809fbc111..fc925e56a 100644 --- a/Source/PythonConsole/Private/SPythonLog.cpp +++ b/Source/PythonConsole/Private/SPythonLog.cpp @@ -48,6 +48,7 @@ class SPythonConsoleEditableTextBox : public SEditableTextBox void SetPythonBox(SPythonConsoleInputBox *box) { SPythonConsoleEditableText *PythonEditableText = (SPythonConsoleEditableText *)EditableText.Get(); + box->HistoryPosition = 0; PythonEditableText->PythonConsoleInputBox = box; } @@ -98,7 +99,7 @@ class SPythonConsoleEditableTextBox : public SEditableTextBox return FReply::Handled(); } else if (InKeyEvent.GetKey() == EKeys::Down) { - if (PythonConsoleInputBox->HistoryPosition < PythonConsoleInputBox->History.Num() - 2) { + if (PythonConsoleInputBox->HistoryPosition < PythonConsoleInputBox->History.Num() - 1) { PythonConsoleInputBox->HistoryPosition++; this->SetText(FText::FromString(PythonConsoleInputBox->History[PythonConsoleInputBox->HistoryPosition])); }