diff options
Diffstat (limited to 'src/tabs')
-rw-r--r-- | src/tabs/status.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tabs/status.rs b/src/tabs/status.rs index 84085a19..428daef0 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -594,6 +594,12 @@ impl Status { } } + fn fetch(&self) { + if self.can_pull() { + self.queue.push(InternalEvent::FetchRemotes); + } + } + fn pull(&self) { if let Some(branch) = self.git_branch_name.last() { self.queue.push(InternalEvent::Pull(branch)); @@ -761,6 +767,12 @@ impl Component for Status { true, self.can_push() && !focus_on_diff, )); + + out.push(CommandInfo::new( + strings::commands::status_fetch(&self.key_config), + self.can_pull(), + !focus_on_diff, + )); out.push(CommandInfo::new( strings::commands::status_pull(&self.key_config), self.can_pull(), @@ -883,6 +895,12 @@ impl Component for Status { { self.push(false); Ok(EventState::Consumed) + } else if key_match(k, self.key_config.keys.fetch) + && !self.is_focus_on_diff() + && self.can_pull() + { + self.fetch(); + Ok(EventState::Consumed) } else if key_match(k, self.key_config.keys.pull) && !self.is_focus_on_diff() && self.can_pull() |