diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-12-16 18:32:50 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-12-20 15:32:22 +0100 |
| commit | 69e7a9341e811bf658f8d75bb43f6613d298c87d (patch) | |
| tree | 0fff59ab0bbc4a7af29079d611bf3cc4c2e8e2fd /history.c | |
| parent | 3eea7a245a7ed49127a222628543f9509a6ff2b6 (diff) | |
| download | tmus-69e7a9341e811bf658f8d75bb43f6613d298c87d.tar.gz tmus-69e7a9341e811bf658f8d75bb43f6613d298c87d.zip | |
Completion search into both directions, added delay to prevent pops when seeking, small refactor for readability
Diffstat (limited to 'history.c')
| -rw-r--r-- | history.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -157,9 +157,10 @@ inputln_addch(struct inputln *line, wchar_t c) { int i; - if (line->len + 1 == line->cap) { + if (line->len + 1 >= line->cap) { line->cap *= 2; - line->buf = realloc(line->buf, line->cap); + line->buf = realloc(line->buf, + line->cap * sizeof(wchar_t)); } for (i = line->len; i > line->cur; i--) |
