Fix case-changing autosuggestions generated mid-token

This fixes a bug where a case-changing autosuggestion generated from the
middle of a token would append too much to the end of the token.

Fixes #8820
This commit is contained in:
ridiculousfish
2022-03-20 20:15:02 -07:00
parent 1763e7d3bc
commit d0d5c62ec7
3 changed files with 9 additions and 2 deletions

View File

@@ -1615,8 +1615,7 @@ wcstring completion_apply_to_command_line(const wcstring &val, complete_flags_t
const wchar_t *begin, *end;
const wchar_t *buff = command_line.c_str();
parse_util_token_extent(buff, cursor_pos, &begin, nullptr, nullptr, nullptr);
end = buff + cursor_pos;
parse_util_token_extent(buff, cursor_pos, &begin, &end, nullptr, nullptr);
wcstring sb(buff, begin - buff);