Skip to content

Commit

Permalink
Merge pull request #49 from ewilliams0305/help_return
Browse files Browse the repository at this point in the history
resolved return to main
  • Loading branch information
ewilliams0305 committed Dec 30, 2023
2 parents 59f2658 + 4a53bd2 commit 101bc68
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/tui/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ var Keys = keyMap{
key.WithHelp("?", "Show help"),
),
Quit: key.NewBinding(
key.WithKeys("q", "esc", "ctrl+c"),
key.WithHelp("q", "quit"),
key.WithKeys("q", "ctrl+q", "esc", "ctrl+c"),
key.WithHelp("ctrl+q", "return"),
),
Programs: key.NewBinding(
key.WithKeys("ctrl+p"),
Expand Down Expand Up @@ -132,7 +132,7 @@ func (m HelpModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case key.Matches(msg, m.keys.Help):
m.help.ShowAll = !m.help.ShowAll
case key.Matches(msg, m.keys.Quit):
return app, tea.Batch(tick, DeviceInfoCommand)
return ReturnToHomeModel(helpState), tea.Batch(tick, DeviceInfoCommand)
}

switch msg.String() {
Expand Down Expand Up @@ -173,7 +173,5 @@ func (m HelpModel) View() string {
func (m HelpModel) renderHelpInfo() string {

helpView := m.help.View(m.keys)
//height := 8 - strings.Count(status, "\n") - strings.Count(helpView, "\n")

return "\n" + helpView
}

0 comments on commit 101bc68

Please sign in to comment.