diff --git a/src/strings.rs b/src/strings.rs index 4c9ea636..99c37a3c 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -286,6 +286,13 @@ pub mod commands { CMD_GROUP_DIFF, ) } + pub fn copy_hash(key_config: &SharedKeyConfig) -> CommandText { + CommandText::new( + format!("Copy Hash [{}]", get_hint(key_config.copy),), + "copy selected commit hash to clipboard", + CMD_GROUP_DIFF, + ) + } pub fn diff_home_end( key_config: &SharedKeyConfig, ) -> CommandText { diff --git a/src/tabs/revlog.rs b/src/tabs/revlog.rs index d3184753..9a2a6735 100644 --- a/src/tabs/revlog.rs +++ b/src/tabs/revlog.rs @@ -287,6 +287,12 @@ impl Component for Revlog { self.visible || force_all, )); + out.push(CommandInfo::new( + strings::commands::copy_hash(&self.key_config), + true, + self.visible || force_all, + )); + visibility_blocking(self) }