From 41f8b9a78561e521f9d82fc05514bf2422b3df28 Mon Sep 17 00:00:00 2001 From: BanceDev Date: Thu, 5 Sep 2024 08:48:51 -0400 Subject: bugfix on arrowkey movement after browsing history --- src/lush.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lush.c b/src/lush.c index b070fa6..15e62af 100644 --- a/src/lush.c +++ b/src/lush.c @@ -237,12 +237,16 @@ char *lush_read_line() { case 'C': // right arrow if (pos < strlen(buffer)) { pos++; + // if modifying text reset history + history_pos = -1; reprint_buffer(buffer, &pos, history_pos); } break; case 'D': // left arrow if (pos > 0) { pos--; + // if modifying text reset history + history_pos = -1; reprint_buffer(buffer, &pos, history_pos); } break; -- cgit v1.2.3-59-g8ed1b