Skip to content

Commit

Permalink
finalized console history, closed #88
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto De Ioris committed Jan 15, 2017
1 parent e0da051 commit 969311e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/PythonConsole/Private/SPythonLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class SPythonConsoleEditableTextBox : public SEditableTextBox

void SetPythonBox(SPythonConsoleInputBox *box) {
SPythonConsoleEditableText *PythonEditableText = (SPythonConsoleEditableText *)EditableText.Get();
box->HistoryPosition = 0;
PythonEditableText->PythonConsoleInputBox = box;
}

Expand Down Expand Up @@ -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]));
}
Expand Down

0 comments on commit 969311e

Please sign in to comment.