From 87d13f84d824a4a03f6337fb7a183150907a9ebe Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Thu, 7 May 2020 17:06:02 +0200 Subject: [PATCH] show diffed files path in title --- src/components/diff.rs | 4 +++- src/strings.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/diff.rs b/src/components/diff.rs index 25fc6bca..ff716420 100644 --- a/src/components/diff.rs +++ b/src/components/diff.rs @@ -293,11 +293,13 @@ impl DrawableComponent for DiffComponent { style_title = style_title.modifier(Modifier::BOLD); } + let title = + format!("{}{}", strings::TITLE_DIFF, self.current.path); f.render_widget( Paragraph::new(self.get_text(r.width, r.height).iter()) .block( Block::default() - .title(strings::TITLE_DIFF) + .title(title.as_str()) .borders(Borders::ALL) .border_style(style_border) .title_style(style_title), diff --git a/src/strings.rs b/src/strings.rs index 90e8e308..691583c7 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -1,5 +1,5 @@ pub static TITLE_STATUS: &str = "Unstaged Changes [1]"; -pub static TITLE_DIFF: &str = "Diff"; +pub static TITLE_DIFF: &str = "Diff: "; pub static TITLE_INDEX: &str = "Staged Changes [2]"; pub static TAB_STATUS: &str = "Status";