aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-02-13 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-02-13 20:20:20 +0100
commit01b6de7bf33faf0fa81293ca40044d8c09c0f1ac (patch)
treefdd7381ed3f6843ae267f767c1db2795687dd9fc /src/i_events.go
parenttmp (diff)
downloadhardflip-01b6de7bf33faf0fa81293ca40044d8c09c0f1ac.tar.gz
hardflip-01b6de7bf33faf0fa81293ca40044d8c09c0f1ac.tar.bz2
hardflip-01b6de7bf33faf0fa81293ca40044d8c09c0f1ac.tar.xz
hardflip-01b6de7bf33faf0fa81293ca40044d8c09c0f1ac.tar.zst
hardflip-01b6de7bf33faf0fa81293ca40044d8c09c0f1ac.zip
bro is safe
Diffstat (limited to '')
-rw-r--r--src/i_events.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/i_events.go b/src/i_events.go
index 4a82404..38d0643 100644
--- a/src/i_events.go
+++ b/src/i_events.go
@@ -53,7 +53,6 @@ package main
import (
"os"
- "fmt"
"github.com/gdamore/tcell/v2"
"golang.org/x/term"
@@ -297,7 +296,8 @@ func i_events(data *HardData) {
event.Key() == tcell.KeyEnd {
data.litems.curr = data.litems.last
} else if event.Rune() == 'D' &&
- data.ldirs.head != nil {
+ data.litems.head != nil &&
+ data.litems.curr != nil {
ui.mode = DELETE_MODE
} else if event.Rune() == 'l' ||
event.Key() == tcell.KeyEnter {
@@ -330,7 +330,6 @@ func i_events(data *HardData) {
case DELETE_MODE:
if event.Key() == tcell.KeyEscape ||
event.Key() == tcell.KeyCtrlC ||
- event.Rune() == 'q' ||
event.Rune() == 'n' {
ui.mode = NORMAL_MODE
} else if event.Key() == tcell.KeyEnter ||
@@ -357,9 +356,14 @@ func i_events(data *HardData) {
break
} else {
data.opts.GPG = data.keys[event.Rune() - 48 - 1][0]
+ ui.s.HideCursor()
}
} else {
- // TODO: confirm
+ if event.Rune() == 'y' {
+ ui.mode = NORMAL_MODE
+ } else if event.Rune() == 'n' {
+ data.opts.GPG = ""
+ }
}
}