Skip to content

Commit a4dfe75

Browse files
committed
Center help messages (and alerts)
1 parent 9afad85 commit a4dfe75

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

cli.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func storyHandler(ch string) {
2929
} else {
3030
cli.Alert("Please enter a number to select a comment")
3131
}
32+
input = ""
3233
break
3334
case "o":
3435
if num, err := strconv.Atoi(input); err == nil {
@@ -141,7 +142,7 @@ func runCli() {
141142

142143
cli.SetContent(stories)
143144
cli.SetKeyHandler(storyHandler)
144-
cli.SetHelp("\n(n: next, p: previous, <num>c: view comments, <num>o: open in browser, q: quit) ")
145+
cli.SetHelp("(n: next, p: previous, <num>c: view comments, <num>o: open in browser, q: quit) ")
145146

146147
cli.Refresh()
147148
cli.Run()

hncli.go

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func (h *hncli) SetContent(text string) {
6464
func (h *hncli) SetHelp(text string) {
6565
h.helpText = text
6666
h.help.Clear()
67+
h.help.Move(1, 0)
6768
h.help.Print(text)
6869
h.help.Refresh()
6970
}

0 commit comments

Comments
 (0)