From 3dee8bc6f2579c8ec76913b0d75b69270c65d629 Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Tue, 4 Dec 2018 21:07:14 -0800 Subject: [PATCH] Fix 'gg' and 'dd' keypresses --- main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index ea5aa13c..7a5fe2f7 100644 --- a/main.go +++ b/main.go @@ -296,7 +296,6 @@ func eventLoop() { if previousKey == "g" { proc.Top() ui.Render(proc) - previousKey = "" } case "G", "": proc.Bottom() @@ -316,7 +315,6 @@ func eventLoop() { case "d": if previousKey == "d" { proc.Kill() - previousKey = "" } case "": proc.Tab() @@ -325,7 +323,12 @@ func eventLoop() { proc.ChangeSort(e) ui.Render(proc) } - previousKey = e.ID + + if previousKey == e.ID { + previousKey = "" + } else { + previousKey = e.ID + } } } }