aboutsummaryrefslogtreecommitdiffstats
path: root/src/lush.c
diff options
context:
space:
mode:
authorGravatar BanceDev 2024-09-12 21:48:50 -0400
committerGravatar BanceDev 2024-09-12 21:48:50 -0400
commitb5857f5aceed86ddb2c538a14a5ec0d41a269bea (patch)
treea711055be35a31cb7a1e44fcf99b159ec84f7df5 /src/lush.c
parentUpdate build.yml checkout v4 (diff)
fixed bug in input buffer handling due to misplaced print
Diffstat (limited to 'src/lush.c')
-rw-r--r--src/lush.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lush.c b/src/lush.c
index f1befe2..93cb28d 100644
--- a/src/lush.c
+++ b/src/lush.c
@@ -624,7 +624,6 @@ char *get_suggestions_path(const char *str) {
strncpy(result, str, length);
result -= 2;
result[length + 2] = '\0';
- printf("%s", result);
return result;
}
@@ -664,7 +663,7 @@ static void reprint_buffer(char *buffer, int *last_lines, int *pos,
strncpy(suggestion, autocomplete_suggestion, PATH_MAX);
}
- free(suggestions_path);
+ // free(suggestions_path);
int num_lines = ((strlen(buffer) + prompt_length + 1) / width) + 1;
int cursor_pos = (prompt_length + *pos + 1) % width;
@@ -724,6 +723,7 @@ static void reprint_buffer(char *buffer, int *last_lines, int *pos,
((strlen(buffer) + strlen(suggestion) + prompt_length + 1) / width) + 1;
if (suggested_lines > num_lines)
printf("\033[A");
+
// cleanup
free(prompt);
old_buffer_len = strlen(buffer);