Skip to content

Commit ac8e9d4

Browse files
committed
🐛 fix: made shortcuts work
1 parent 0d960e4 commit ac8e9d4

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/popups/conventional_commit.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,6 @@ impl Component for ConventionalCommitPopup {
719719
}
720720
}
721721
}
722-
} else if key_match(key, self.key_config.keys.insert)
723-
{
724-
self.is_insert = true;
725722
} else if key_match(
726723
key,
727724
self.key_config.keys.popup_down,
@@ -733,8 +730,27 @@ impl Component for ConventionalCommitPopup {
733730
) {
734731
self.move_selection(ScrollType::Up);
735732
} else {
736-
if self.input.event(event)?.is_consumed() {
737-
self.update_query();
733+
if self.is_insert {
734+
if self.input.event(event)?.is_consumed() {
735+
self.update_query();
736+
}
737+
} else if key_match(
738+
key,
739+
self.key_config.keys.insert,
740+
) {
741+
self.is_insert = true;
742+
} else {
743+
if let KeyCode::Char(c) = key.code {
744+
if let Some(idx) = self
745+
.quick_shortcuts()
746+
.into_iter()
747+
.position(|ch| ch == c)
748+
{
749+
self.seleted_commit_type = Some(
750+
self.query_results[idx].clone(),
751+
);
752+
}
753+
}
738754
}
739755
}
740756
}

0 commit comments

Comments
 (0)