From d440f3962fa96fe0c9bc7747faa0b6e3fb457b92 Mon Sep 17 00:00:00 2001 From: Draika the Dragon Date: Sun, 21 Apr 2019 14:05:59 +1000 Subject: [PATCH] Up arrow key repeats the same command after pressing enter rather than going to the previous command (#44) Signed-off-by: Draika --- src/com/strongjoshua/console/GUIConsole.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/strongjoshua/console/GUIConsole.java b/src/com/strongjoshua/console/GUIConsole.java index 9e554ea..370951e 100644 --- a/src/com/strongjoshua/console/GUIConsole.java +++ b/src/com/strongjoshua/console/GUIConsole.java @@ -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());