mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
fix scroll command enbled
This commit is contained in:
parent
10bb26e063
commit
6db11857e0
2 changed files with 12 additions and 10 deletions
20
src/app.rs
20
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())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue