show diffed files path in title

This commit is contained in:
Stephan Dilly 2020-05-07 17:06:02 +02:00
parent f3a67e878f
commit 87d13f84d8
2 changed files with 4 additions and 2 deletions

View file

@ -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),

View file

@ -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";