reader: only flash entire commandline if token is empty

So `git add dsfiojdsoif<TAB>` flashes the token, `git add <TAB>`
flashes the entire commandline because there is no token to flash
This commit is contained in:
Fabian Boehm
2025-01-30 17:13:09 +01:00
parent 4ae3c487a6
commit e63fea1127

View File

@@ -6342,7 +6342,11 @@ fn handle_completions(&mut self, token_range: Range<usize>) -> bool {
let len = comp.len();
if len == 0 {
// No suitable completions found, flash screen and return.
self.flash(0..self.command_line.len());
if token_range.is_empty() {
self.flash(0..self.command_line.len());
} else {
self.flash(token_range);
}
return false;
} else if len == 1 {
// Exactly one suitable completion found - insert it.