mirror of
https://github.com/extrawurst/gitui.git
synced 2024-11-23 11:42:56 +03:00
fix scroll command enbled
This commit is contained in:
parent
10bb26e063
commit
6db11857e0
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 New Issue
Block a user