Skip to content

Commit

Permalink
feat(message): 🎉 type select to fuzzy select.
Browse files Browse the repository at this point in the history
ommit d:escript.
  • Loading branch information
sdttttt committed Jun 9, 2022
1 parent 18dffe7 commit 8e4c8fc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ lto = true
[dependencies]
clap = "3.1.18"
console = "0.15.0"
dialoguer = "0.10.1"
dialoguer = { version = "0.10.1", features = ["editor", "fuzzy-select"] }
git2 = "0.14.4"
toml = "0.5.9"
serde = { version = "1.0.137", features = ["derive"] }
Expand Down
6 changes: 3 additions & 3 deletions src/message.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dialoguer::{theme::ColorfulTheme, Input, Select};
use dialoguer::{theme::ColorfulTheme, FuzzySelect, Input};
use dialoguer::{Confirm, Editor};

use crate::log::grc_err_println;
Expand Down Expand Up @@ -149,11 +149,11 @@ impl Messager {

/// type of commit message.
fn ask_type(&mut self) {
let selection = Select::with_theme(&ColorfulTheme::default())
let selection = FuzzySelect::with_theme(&ColorfulTheme::default())
.items(&self.type_list())
.default(0)
.interact()
.unwrap();
.expect("Failed to select commit type.");

// Custom TYPE.
if selection == self.commit_type_descript.len() - 1 {
Expand Down

0 comments on commit 8e4c8fc

Please sign in to comment.