From 5cddfdb1623b40337e760d9b9f568310b036208c Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Fri, 2 Aug 2024 01:08:07 +0100 Subject: [PATCH] Simplified placeholder text logic Co-authored-by: Andrii Dokhniak --- src/search.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/search.rs b/src/search.rs index f58c0d5f..68827c24 100644 --- a/src/search.rs +++ b/src/search.rs @@ -36,12 +36,8 @@ impl SearchBar { pub fn draw(&self, frame: &mut Frame, area: Rect, state: &AppState) { //Set the search bar text (If empty use the placeholder) - let display_text = if self.search_input.is_empty() { - if self.in_search_mode { - Span::raw("") - } else { - Span::raw("Press / to search") - } + let display_text = if !self.in_search_mode && self.search_input.is_empty() { + Span::raw("Press / to search") } else { Span::raw(&self.search_input) };