Skip to content

Commit c2d3d2a

Browse files
added navigation menu (#90)
1 parent c348f2d commit c2d3d2a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/types.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
2626
switch msg := msg.(type) {
2727
case tea.KeyMsg:
2828
switch msg.String() {
29-
case "q", "ctrl+c":
30-
// Quit the program when in selection mode
29+
case "q", "esc", "ctrl+c":
3130
m.selectedOption = "quit"
3231
return m, tea.Quit
3332
case "enter":
@@ -48,7 +47,10 @@ func (m model) View() string {
4847
return ""
4948
}
5049
// Otherwise, display the table
51-
return "Select a type! Hit 'Q' or 'CTRL-C' to quit.\n" + typesTableBorder.Render(m.table.View()) + "\n"
50+
return "Select a type!\n" +
51+
typesTableBorder.Render(m.table.View()) +
52+
"\n" +
53+
keyMenu.Render("↑ (move up) • ↓ (move down)\nctrl+c | esc (quit) • enter (select)")
5254
}
5355

5456
// Function to display type details after a type is selected

0 commit comments

Comments
 (0)