diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2024-02-12 06:26:19 -0600 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-02-12 13:48:48 +0100 |
commit | cdc90afbaa1a6ff7d0900b6ce904a1e51e31bcd1 (patch) | |
tree | 4765fa753846ffe5a9d07c1fe442e8e1f2db0c61 /app/exline.go | |
parent | f001f65240f85f0af91703dbcc0b068c0797297a (diff) | |
download | aerc-cdc90afbaa1a6ff7d0900b6ce904a1e51e31bcd1.tar.gz |
aerc: replace tcell keys with vaxis keys
Replace all instances of tcell key usage with vaxis keys
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'app/exline.go')
-rw-r--r-- | app/exline.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/exline.go b/app/exline.go index 7eb6fde3..e8b0069e 100644 --- a/app/exline.go +++ b/app/exline.go @@ -1,8 +1,6 @@ package app import ( - "github.com/gdamore/tcell/v2" - "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/ui" @@ -83,20 +81,20 @@ func (ex *ExLine) Focus(focus bool) { } func (ex *ExLine) Event(event vaxis.Event) bool { - if event, ok := event.(*tcell.EventKey); ok { - switch event.Key() { - case tcell.KeyEnter, tcell.KeyCtrlJ: + if key, ok := event.(vaxis.Key); ok { + switch { + case key.Matches(vaxis.KeyEnter), key.Matches('j', vaxis.ModCtrl): cmd := ex.input.String() ex.input.Focus(false) ex.commit(cmd) ex.finish() - case tcell.KeyUp: + case key.Matches(vaxis.KeyUp): ex.input.Set(ex.cmdHistory.Prev()) ex.Invalidate() - case tcell.KeyDown: + case key.Matches(vaxis.KeyDown): ex.input.Set(ex.cmdHistory.Next()) ex.Invalidate() - case tcell.KeyEsc, tcell.KeyCtrlC: + case key.Matches(vaxis.KeyEsc), key.Matches('c', vaxis.ModCtrl): ex.input.Focus(false) ex.cmdHistory.Reset() ex.finish() |