fix: close Ticket 11 hardening review gaps
This commit is contained in:
@@ -21,6 +21,7 @@ const (
|
||||
type confirmationDialog struct {
|
||||
request app.Confirmation
|
||||
confirmFocused bool
|
||||
offset int
|
||||
}
|
||||
|
||||
func newConfirmationDialog(request app.Confirmation) confirmationDialog {
|
||||
@@ -29,6 +30,14 @@ func newConfirmationDialog(request app.Confirmation) confirmationDialog {
|
||||
|
||||
func (d *confirmationDialog) update(key string) confirmationResult {
|
||||
switch key {
|
||||
case "pgup":
|
||||
d.offset = max(0, d.offset-5)
|
||||
case "pgdown":
|
||||
d.offset += 5
|
||||
case "home":
|
||||
d.offset = 0
|
||||
case "end":
|
||||
d.offset = 1 << 20
|
||||
case "left", "right", "tab", "shift+tab":
|
||||
d.confirmFocused = !d.confirmFocused
|
||||
case "y":
|
||||
|
||||
Reference in New Issue
Block a user