diff --git a/src/options_test.go b/src/options_test.go index 7e7b4c6e..7e23215d 100644 --- a/src/options_test.go +++ b/src/options_test.go @@ -330,10 +330,6 @@ func TestParseEveryEvent(t *testing.T) { } } - // KeyName round-trips with the original duration - if got := (tui.Event{Type: tui.Every, Char: 2000}).KeyName(); got != "every(2)" { - t.Errorf("KeyName: %q != every(2)", got) - } } func TestColorSpec(t *testing.T) { diff --git a/src/terminal.go b/src/terminal.go index 8dae78ac..bd85ca6d 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -6478,7 +6478,9 @@ func (t *Terminal) Loop() error { previousInput := t.input previousCx := t.cx previousVersion := t.version - t.lastKey = event.KeyName() + if event.Type < tui.Invalid { + t.lastKey = event.KeyName() + } updatePreviewWindow := func(forcePreview bool) { t.resizeWindows(forcePreview, false) req(reqPrompt, reqList, reqInfo, reqHeader, reqFooter) diff --git a/src/tui/tui.go b/src/tui/tui.go index 1c35b12b..97ba2065 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -257,10 +257,6 @@ func (e Event) KeyName() string { return me.Name() } - if e.Type == Every { - return "every(" + strconv.FormatFloat(float64(e.Char)/1000, 'f', -1, 64) + ")" - } - if e.Type >= Invalid { return "" }