]> git.lizzy.rs Git - micro.git/commitdiff
Show key name in raw pane
authorZachary Yedidia <zyedidia@gmail.com>
Tue, 9 Jun 2020 19:57:52 +0000 (15:57 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Tue, 9 Jun 2020 19:57:52 +0000 (15:57 -0400)
internal/action/rawpane.go

index 059679dcea945ee186092e92fd1115f49ab20b9f..d39adddb5c50383ebb5296c3c1ca71c2b1a58939 100644 (file)
@@ -35,6 +35,13 @@ func (h *RawPane) HandleEvent(event tcell.Event) {
        }
 
        h.Buf.Insert(h.Cursor.Loc, reflect.TypeOf(event).String()[7:])
+
+       switch e := event.(type) {
+       case *tcell.EventKey:
+               h.Buf.Insert(h.Cursor.Loc, fmt.Sprintf(": %s", e.Name()))
+       }
+
        h.Buf.Insert(h.Cursor.Loc, fmt.Sprintf(": %q\n", event.EscSeq()))
+
        h.Relocate()
 }