Skip to content

Commit f45af0e

Browse files
author
Stephan Dilly
committed
fix multiple tags not being seperated in details view (fixes #212)
1 parent f832285 commit f45af0e

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- min size for relative popups on small terminals ([#179](https://github.com/extrawurst/gitui/issues/179))
2727
- fix crash on resizing terminal to very small width ([#198](https://github.com/extrawurst/gitui/issues/198))
2828
- fix broken tags when using a different internal representation ([#206](https://github.com/extrawurst/gitui/issues/206))
29+
- tags are not cleanly seperated in details view ([#212](https://github.com/extrawurst/gitui/issues/212))
2930

3031
## [0.8.1] - 2020-07-07
3132

src/components/commit_details/details.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use asyncgit::{
1212
CWD,
1313
};
1414
use crossterm::event::Event;
15+
use itertools::Itertools;
1516
use std::borrow::Cow;
1617
use sync::CommitTags;
1718
use tui::{
@@ -159,12 +160,20 @@ impl DetailsComponent {
159160
self.theme.text(false, false),
160161
));
161162

162-
for tag in &self.tags {
163-
res.push(Text::Styled(
164-
Cow::from(tag),
165-
self.theme.text(true, false),
166-
));
167-
}
163+
res.extend(
164+
self.tags
165+
.iter()
166+
.map(|tag| {
167+
Text::Styled(
168+
Cow::from(tag),
169+
self.theme.text(true, false),
170+
)
171+
})
172+
.intersperse(Text::Styled(
173+
Cow::from(","),
174+
self.theme.text(true, false),
175+
)),
176+
);
168177
}
169178

170179
res

0 commit comments

Comments
 (0)