aboutsummaryrefslogtreecommitdiffstats
path: root/ui.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2023-07-29 10:20:59 -0230
committerSam Anthony <sam@samanthony.xyz>2023-07-29 10:20:59 -0230
commitfd46878cfa5978a081f1ffdb865394aff234dbc9 (patch)
tree49893ed63e70ca9ec55d29a243f88f0ec1c26ef2 /ui.go
parenta253229dbbef5e09449884febacdfbbd4de85d6d (diff)
downloadpfc-fd46878cfa5978a081f1ffdb865394aff234dbc9.zip
CE and AC commands
Diffstat (limited to 'ui.go')
-rw-r--r--ui.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui.go b/ui.go
index aa0f114..6596b77 100644
--- a/ui.go
+++ b/ui.go
@@ -39,6 +39,11 @@ func (ui UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return ui, tea.Quit
case "J", "K":
ui.calc.swap()
+ case "D":
+ ui.calc.buf = ""
+ case "C":
+ ui.calc.buf = ""
+ ui.calc.stack = ui.calc.stack[:0]
case "+", "-", "*", "/", "%", "^":
if err := ui.calc.performOp(msg.String()[0]); err != nil {
panic(err)