From f44da64b326ea4a798d8bee641aaeba286236165 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Thu, 9 Feb 2023 09:55:49 -0330 Subject: press Shift+d to clear stack and buffer --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/input.rs | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 652fe7b..9dfc298 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,7 +113,7 @@ dependencies = [ [[package]] name = "pfc" -version = "0.3.4" +version = "0.4.0" dependencies = [ "crossterm", "tui", diff --git a/Cargo.toml b/Cargo.toml index ec6b618..d8fa9d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pfc" -version = "0.3.4" +version = "0.4.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/input.rs b/src/input.rs index 6362e48..998d380 100644 --- a/src/input.rs +++ b/src/input.rs @@ -11,6 +11,13 @@ impl Calculator { } _ => {} }, + KeyModifiers::SHIFT => match key.code { + KeyCode::Char('D') => { + self.input_buffer = String::new(); + self.stack = Vec::new(); + } + _ => {} + }, KeyModifiers::NONE => match key.code { KeyCode::Char('q') => { return Signal::Exit; -- cgit v1.2.3