From fba93ec50a0c5bbc9df6433fc857f056222e2f6a Mon Sep 17 00:00:00 2001 From: nyx Date: Fri, 4 Oct 2024 00:39:04 -0400 Subject: [PATCH 1/2] dont allow the user to bring up the command desc if there is none --- tui/src/state.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tui/src/state.rs b/tui/src/state.rs index 36865557..7b666d8e 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -666,8 +666,10 @@ impl AppState { fn enable_description(&mut self) { if let Some(command_description) = self.get_selected_description() { - let description = FloatingText::new(command_description, FloatingTextMode::Description); - self.spawn_float(description, 80, 80); + if !command_description.is_empty() { + let description = FloatingText::new(command_description, FloatingTextMode::Description); + self.spawn_float(description, 80, 80); + } } } From 919b55209ef13670817980f1041ecf4bc43bb352 Mon Sep 17 00:00:00 2001 From: nyx Date: Fri, 4 Oct 2024 00:45:16 -0400 Subject: [PATCH 2/2] obey our god lints --- tui/src/state.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tui/src/state.rs b/tui/src/state.rs index 7b666d8e..b7cd20fe 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -667,7 +667,8 @@ impl AppState { fn enable_description(&mut self) { if let Some(command_description) = self.get_selected_description() { if !command_description.is_empty() { - let description = FloatingText::new(command_description, FloatingTextMode::Description); + let description = + FloatingText::new(command_description, FloatingTextMode::Description); self.spawn_float(description, 80, 80); } }