Skip to content

Commit c9a2f30

Browse files
committed
🐛 fix: bad display for selection of commit type
1 parent 2c45756 commit c9a2f30

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/popups/conventional_commit.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,12 @@ impl ConventionalCommitPopup {
442442
})
443443
.collect_vec()
444444
} else {
445+
let max_len = self
446+
.query_results
447+
.iter()
448+
.map(|s| s.to_string().len())
449+
.max();
450+
445451
self.query_results
446452
.iter()
447453
.enumerate()
@@ -453,14 +459,14 @@ impl ConventionalCommitPopup {
453459
commit_type_string.as_str(),
454460
width - 4, // ` [k]`
455461
);
456-
//FIXME: not working
462+
457463
(
458464
self.selected_index == idx,
459465
format!(
460466
"{:w$} [{}]",
461467
text,
462468
quick_shortcuts[idx],
463-
w = width,
469+
w = max_len.unwrap_or_default(),
464470
),
465471
)
466472
})

0 commit comments

Comments
 (0)