summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorChristoph Rüßler <christoph.ruessler@mailbox.org>2021-04-24 09:08:25 +0200
committerStephan Dilly <dilly.stephan@gmail.com>2021-04-24 14:02:51 +0200
commite7b703b9221e895f660953c34b30e929657368af (patch)
tree9395dba641b132e588946d6ae084a5fdf80b2832 /src/ui
parentf081cbeb173509293dd8cced03651a6ce9707e20 (diff)
Improve blame view
- Set default shortcut to `B` instead of `b` because the latter would shadow `[b]ranches`. - Add scrollbar. - Show resolved commit id in title instead of `HEAD`. - Make commit id bold if it is the commit id the file is blamed at. - Don’t run blame on a binary file. - Add shortcut for inspecting a commit in blame view.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/style.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/style.rs b/src/ui/style.rs
index b06d2750..2a19e1f2 100644
--- a/src/ui/style.rs
+++ b/src/ui/style.rs
@@ -229,6 +229,19 @@ impl Theme {
)
}
+ pub fn commit_hash_in_blame(
+ &self,
+ is_blamed_commit: bool,
+ ) -> Style {
+ if is_blamed_commit {
+ Style::default()
+ .fg(self.commit_hash)
+ .add_modifier(Modifier::BOLD)
+ } else {
+ Style::default().fg(self.commit_hash)
+ }
+ }
+
pub fn push_gauge(&self) -> Style {
Style::default()
.fg(self.push_gauge_fg)