Skip to content

Commit

Permalink
Up arrow key repeats the same command after pressing enter rather tha…
Browse files Browse the repository at this point in the history
…n going to the previous command (#44)

Signed-off-by: Draika <[email protected]>
  • Loading branch information
AkashaP authored and StrongJoshua committed Apr 21, 2019
1 parent 73b6df3 commit d440f39
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/com/strongjoshua/console/GUIConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ protected KeyListener (TextField tf) {
}

if (keycode == Keys.ENTER && !hidden) {
commandHistory.getNextCommand(); // Makes up arrow key repeat the same command after pressing enter
return display.submit();
} else if (keycode == Keys.UP && !hidden) {
input.setText(commandHistory.getPreviousCommand());
Expand Down

0 comments on commit d440f39

Please sign in to comment.