diff --git a/Cargo.lock b/Cargo.lock index 758f055..f947b71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1490,7 +1490,7 @@ dependencies = [ [[package]] name = "nsigner" -version = "0.0.5" +version = "0.0.6" dependencies = [ "base64", "chacha20poly1305", diff --git a/Cargo.toml b/Cargo.toml index f5dcdec..79b34eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nsigner" -version = "0.0.6" +version = "0.0.7" edition = "2021" license = "MIT" description = "Attended Nostr signing daemon — Rust port of n_signer" diff --git a/src/lib.rs b/src/lib.rs index 3029342..aeb66e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,4 +31,4 @@ pub mod error; pub use error::NsignerError; /// Version string (matches C NSIGNER_VERSION). -pub const VERSION: &str = "v0.0.6"; +pub const VERSION: &str = "v0.0.7"; diff --git a/src/tui.rs b/src/tui.rs index fb8e06d..f0a3571 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -587,8 +587,12 @@ impl App { // ── Seed entry ────────────────────────────────────────────────────── fn handle_seed_key(&mut self, key: KeyEvent) { - // 'g' generates a new mnemonic directly. - if key.code == KeyCode::Char('g') || key.code == KeyCode::Char('G') { + // 'g' generates a new mnemonic only when the input buffer is empty. + // If the user has already started typing, 'g' is just a letter in a + // mnemonic word. + if (key.code == KeyCode::Char('g') || key.code == KeyCode::Char('G')) + && self.unlock_input.buffer.is_empty() + { match self.mnemonic.generate(12) { Ok(phrase) => { self.generated_phrase = phrase;