Make full autosuggestions case-correcting again

Fixes ca21872d14 (Clean up the accept-autosuggestion code path a
little bit, 2024-11-14).
Fixes #10915
This commit is contained in:
Johannes Altmanninger 2024-12-18 15:58:34 +01:00
parent 9abec243a4
commit 039011bc81

View file

@ -4470,6 +4470,13 @@ impl<'a> Reader<'a> {
match amount {
AutosuggestionPortion::Count(count) => {
let pos = self.command_line.len();
if count == usize::MAX {
self.data.replace_substring(
EditableLineTag::Commandline,
0..self.command_line.len(),
self.autosuggestion.text.clone(),
);
} else {
let count = count.min(self.autosuggestion.text.len() - pos);
if count != 0 {
self.data.replace_substring(
@ -4479,6 +4486,7 @@ impl<'a> Reader<'a> {
);
}
}
}
AutosuggestionPortion::PerMoveWordStyle(style) => {
// Accept characters according to the specified style.
let mut state = MoveWordStateMachine::new(style);