diff --git a/src/app.rs b/src/app.rs index 959cc4be..1e96f862 100644 --- a/src/app.rs +++ b/src/app.rs @@ -163,8 +163,10 @@ impl App { .render(f, chunks[1]); let mut cmds = self.commit.commands(); - cmds.extend(self.index.commands()); - cmds.extend(self.index_wd.commands()); + if !self.commit.is_visible() { + cmds.extend(self.index.commands()); + cmds.extend(self.index_wd.commands()); + } cmds.extend(self.commands()); self.draw_commands(f, chunks_main[2], cmds); @@ -208,14 +210,14 @@ impl App { return; } - if self.index.event(ev) { - return; - } - if self.index_wd.event(ev) { - return; - } - if !self.commit.is_visible() { + if self.index.event(ev) { + return; + } + if self.index_wd.event(ev) { + return; + } + if ev == Event::Key(KeyCode::Esc.into()) || ev == Event::Key(KeyCode::Char('q').into()) { diff --git a/src/components/index.rs b/src/components/index.rs index 8cfef0a4..aa3702a3 100644 --- a/src/components/index.rs +++ b/src/components/index.rs @@ -88,7 +88,7 @@ impl Component for IndexComponent { if self.focused { return vec![CommandInfo { name: "Scroll [↑↓]".to_string(), - enabled: self.items.len() > 0, + enabled: self.items.len() > 1, }]; }