aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2023-02-09 09:55:49 -0330
committerSam Anthony <sam@samanthony.xyz>2023-02-09 09:55:49 -0330
commitf44da64b326ea4a798d8bee641aaeba286236165 (patch)
tree0e22d7e2d97f2985e6a5fabcade09a0c7ad158f0
parentd74b80a4fc15884ef4bc5986c65281f50a94aba9 (diff)
downloadpfc-f44da64b326ea4a798d8bee641aaeba286236165.zip
press Shift+d to clear stack and buffer
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/input.rs7
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;