From 446d52ce7c75f57ca85f3270ebc0dde846268906 Mon Sep 17 00:00:00 2001 From: Liam <33645555+lj3954@users.noreply.github.com> Date: Sun, 22 Sep 2024 11:11:43 -0500 Subject: [PATCH] fix: Correctly enter up directories (..) (#598) --- 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 a9049528..f033001e 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -512,7 +512,8 @@ impl AppState { } pub fn selected_item_is_cmd(&self) -> bool { - !self.selected_item_is_dir() + // Any item that is not a directory or up directory (..) must be a command + !(self.selected_item_is_up_dir() || self.selected_item_is_dir()) } pub fn selected_item_is_up_dir(&self) -> bool { let selected_index = self.selection.selected().unwrap_or(0);