From e63fea1127d5171e33bc7e279635492e0b475aca Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Thu, 30 Jan 2025 17:13:09 +0100 Subject: [PATCH] reader: only flash entire commandline if token is empty So `git add dsfiojdsoif` flashes the token, `git add ` flashes the entire commandline because there is no token to flash --- src/reader.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/reader.rs b/src/reader.rs index 47c8ca058..1c6d0381c 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -6342,7 +6342,11 @@ fn handle_completions(&mut self, token_range: Range) -> 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.