aboutsummaryrefslogtreecommitdiffstats
path: root/src/lush.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lush.c')
-rw-r--r--src/lush.c4
1 files changed, 4 insertions, 0 deletions
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;