mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-26 11:45:08 +00:00
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:
parent
9abec243a4
commit
039011bc81
1 changed files with 12 additions and 4 deletions
|
@ -4470,13 +4470,21 @@ impl<'a> Reader<'a> {
|
||||||
match amount {
|
match amount {
|
||||||
AutosuggestionPortion::Count(count) => {
|
AutosuggestionPortion::Count(count) => {
|
||||||
let pos = self.command_line.len();
|
let pos = self.command_line.len();
|
||||||
let count = count.min(self.autosuggestion.text.len() - pos);
|
if count == usize::MAX {
|
||||||
if count != 0 {
|
|
||||||
self.data.replace_substring(
|
self.data.replace_substring(
|
||||||
EditableLineTag::Commandline,
|
EditableLineTag::Commandline,
|
||||||
pos..pos,
|
0..self.command_line.len(),
|
||||||
self.autosuggestion.text[pos..pos + count].to_owned(),
|
self.autosuggestion.text.clone(),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
let count = count.min(self.autosuggestion.text.len() - pos);
|
||||||
|
if count != 0 {
|
||||||
|
self.data.replace_substring(
|
||||||
|
EditableLineTag::Commandline,
|
||||||
|
pos..pos,
|
||||||
|
self.autosuggestion.text[pos..pos + count].to_owned(),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AutosuggestionPortion::PerMoveWordStyle(style) => {
|
AutosuggestionPortion::PerMoveWordStyle(style) => {
|
||||||
|
|
Loading…
Reference in a new issue