Skip to content

Commit

Permalink
fix key help
Browse files Browse the repository at this point in the history
  • Loading branch information
robinovitch61 committed Nov 12, 2023
1 parent 0ad04a6 commit 490163d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/tui/nomad/pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,19 @@ func GetPageKeyHelp(
logType LogType,
compact, inJobsMode bool,
) string {
// TODO LEO: ensure q/ctrlc is correct in all pages
if compact {
changeKeyHelp(&keymap.KeyMap.Compact, "expand header")
return getShortHelp([]key.Binding{keymap.KeyMap.Compact})
} else {
changeKeyHelp(&keymap.KeyMap.Compact, "compact")
}

if filterFocused || enteringInput {
keymap.KeyMap.Exit.SetHelp("ctrl+c", "exit")
} else {
keymap.KeyMap.Exit.SetHelp("q/ctrl+c", "exit")
}

firstRow := []key.Binding{keymap.KeyMap.Exit}

if !saving && !filterFocused {
Expand Down Expand Up @@ -447,8 +452,7 @@ func GetPageKeyHelp(
}
if inPty {
changeKeyHelp(&keymap.KeyMap.Back, "disable input")
secondRow = []key.Binding{keymap.KeyMap.Back}
return getShortHelp(firstRow) + "\n" + getShortHelp(secondRow)
return getShortHelp([]key.Binding{keymap.KeyMap.Back})
} else {
if webSocketConnected {
changeKeyHelp(&keymap.KeyMap.Forward, "enable input")
Expand Down

0 comments on commit 490163d

Please sign in to comment.