Skip to content

Commit 87d13f8

Browse files
author
Stephan Dilly
committed
show diffed files path in title
1 parent f3a67e8 commit 87d13f8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/diff.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,13 @@ impl DrawableComponent for DiffComponent {
293293
style_title = style_title.modifier(Modifier::BOLD);
294294
}
295295

296+
let title =
297+
format!("{}{}", strings::TITLE_DIFF, self.current.path);
296298
f.render_widget(
297299
Paragraph::new(self.get_text(r.width, r.height).iter())
298300
.block(
299301
Block::default()
300-
.title(strings::TITLE_DIFF)
302+
.title(title.as_str())
301303
.borders(Borders::ALL)
302304
.border_style(style_border)
303305
.title_style(style_title),

src/strings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub static TITLE_STATUS: &str = "Unstaged Changes [1]";
2-
pub static TITLE_DIFF: &str = "Diff";
2+
pub static TITLE_DIFF: &str = "Diff: ";
33
pub static TITLE_INDEX: &str = "Staged Changes [2]";
44

55
pub static TAB_STATUS: &str = "Status";

0 commit comments

Comments
 (0)