From fb9007df49c65eedf64606ed7116ae6d6962725e Mon Sep 17 00:00:00 2001 From: "Tobias P.L Wennberg" Date: Sun, 12 Jan 2025 14:59:06 +0100 Subject: [PATCH] OBS... --- input_parser/input_parser.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/input_parser/input_parser.go b/input_parser/input_parser.go index b4e0db6..264e5a3 100644 --- a/input_parser/input_parser.go +++ b/input_parser/input_parser.go @@ -101,18 +101,19 @@ func input_str(env *environment.Env) string { } else { history_index = len(env.History)-1 input = "" - if r, _, _ := reader.ReadRune(); r == 65 { // UPP - if history_index > 0 { - history_index-- - input = env.History[history_index] + if r, _, _ := reader.ReadRune(); r == 65 { // UPP + if history_index > 0 { + history_index-- + input = env.History[history_index] + } } - } - if r, _, _ := reader.ReadRune(); r != 66 { //DOWN - if history_index < len(env.History)-1 { - history_index++ - input = env.History[history_index] - } else { - input = "" + if r, _, _ := reader.ReadRune(); r != 66 { //DOWN + if history_index < len(env.History)-1 { + history_index++ + input = env.History[history_index] + } else { + input = "" + } } } case 127: //packspace