diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2023-02-09 09:55:49 -0330 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2023-02-09 09:55:49 -0330 |
| commit | f44da64b326ea4a798d8bee641aaeba286236165 (patch) | |
| tree | 0e22d7e2d97f2985e6a5fabcade09a0c7ad158f0 | |
| parent | d74b80a4fc15884ef4bc5986c65281f50a94aba9 (diff) | |
| download | pfc-f44da64b326ea4a798d8bee641aaeba286236165.zip | |
press Shift+d to clear stack and buffer
| -rw-r--r-- | Cargo.lock | 2 | ||||
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/input.rs | 7 |
3 files changed, 9 insertions, 2 deletions
@@ -113,7 +113,7 @@ dependencies = [ [[package]] name = "pfc" -version = "0.3.4" +version = "0.4.0" dependencies = [ "crossterm", "tui", @@ -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; |