diff --git a/src/keys.rs b/src/keys.rs index 153869bf..064dd9e1 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -64,7 +64,7 @@ pub struct KeyConfig { pub delete_branch: KeyEvent, pub push: KeyEvent, pub force_push: KeyEvent, - pub fetch: KeyEvent, + pub pull: KeyEvent, } #[rustfmt::skip] @@ -118,7 +118,7 @@ impl Default for KeyConfig { delete_branch: KeyEvent{code: KeyCode::Char('D'), modifiers: KeyModifiers::SHIFT}, push: KeyEvent { code: KeyCode::Char('p'), modifiers: KeyModifiers::empty()}, force_push: KeyEvent { code: KeyCode::Char('P'), modifiers: KeyModifiers::SHIFT}, - fetch: KeyEvent { code: KeyCode::Char('f'), modifiers: KeyModifiers::empty()}, + pull: KeyEvent { code: KeyCode::Char('f'), modifiers: KeyModifiers::empty()}, } } } diff --git a/src/strings.rs b/src/strings.rs index 401382af..f9db6bf7 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -838,4 +838,14 @@ pub mod commands { CMD_GROUP_GENERAL, ) } + pub fn status_pull(key_config: &SharedKeyConfig) -> CommandText { + CommandText::new( + format!( + "Pull [{}]", + key_config.get_hint(key_config.pull), + ), + "fetch/merge", + CMD_GROUP_GENERAL, + ) + } } diff --git a/src/tabs/status.rs b/src/tabs/status.rs index 69d7ad79..c3750aed 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -414,7 +414,7 @@ impl Status { } } - fn fetch(&self) { + fn pull(&self) { if let Some(branch) = self.git_branch_name.last() { self.queue .borrow_mut() @@ -470,6 +470,11 @@ impl Component for Status { self.can_push(), true, )); + out.push(CommandInfo::new( + strings::commands::status_pull(&self.key_config), + true, + true, + )); } { @@ -582,8 +587,8 @@ impl Component for Status { } else if k == self.key_config.push { self.push(false); Ok(true) - } else if k == self.key_config.fetch { - self.fetch(); + } else if k == self.key_config.pull { + self.pull(); Ok(true) } else { Ok(false)