Fix selected-cmd bug (#638)

This commit is contained in:
JEEVITHA KANNAN K S 2024-10-01 01:53:16 +05:30 committed by GitHub
parent 8111649c8c
commit b549510895
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -615,7 +615,8 @@ impl AppState {
pub fn selected_item_is_cmd(&self) -> bool { pub fn selected_item_is_cmd(&self) -> bool {
// Any item that is not a directory or up directory (..) must be a command // 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()) self.selection.selected().is_some()
&& !(self.selected_item_is_up_dir() || self.selected_item_is_dir())
} }
pub fn selected_item_is_up_dir(&self) -> bool { pub fn selected_item_is_up_dir(&self) -> bool {
let selected_index = self.selection.selected().unwrap_or(0); let selected_index = self.selection.selected().unwrap_or(0);