diff options
author | Christian Rocha <christian@rocha.is> | 2020-07-14 18:05:36 -0400 |
---|---|---|
committer | Christian Muehlhaeuser <muesli@gmail.com> | 2020-10-05 13:49:31 +0200 |
commit | dd8c6508306903fdb555c1f7dd9b4bdf57760dc5 (patch) | |
tree | ab281f156b513e08848606e197e9c3c4dbcc57e3 /ui | |
parent | ac872bf41f21335b8723ced5473c5c36c3027ed0 (diff) |
Only show memo key in pager help for user stashed markdown
Diffstat (limited to 'ui')
-rw-r--r-- | ui/pager.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/ui/pager.go b/ui/pager.go index 5df3243..bb9caf8 100644 --- a/ui/pager.go +++ b/ui/pager.go @@ -27,7 +27,7 @@ const ( ) var ( - pagerHelpHeight = strings.Count(pagerHelpView(0), "\n") + pagerHelpHeight = strings.Count(pagerHelpView(pagerModel{}, 0), "\n") noteHeading = te.String(noteHeadingText). Foreground(common.Cream.Color()). @@ -247,7 +247,7 @@ func pagerView(m pagerModel) string { } if m.showHelp { - fmt.Fprintf(&b, pagerHelpView(m.width)) + fmt.Fprintf(&b, pagerHelpView(m, m.width)) } return b.String() @@ -294,10 +294,19 @@ func pagerSetNoteView(b *strings.Builder, m pagerModel) { fmt.Fprint(b, textinput.View(m.textInput)) } -func pagerHelpView(width int) (s string) { +func pagerHelpView(m pagerModel, width int) (s string) { + col1 := [2]string{ + "m set memo", + "esc/q back to stash", + } + if m.currentDocument != nil && m.currentDocument.markdownType != stashedMarkdown { + col1[0] = col1[1] + col1[1] = "" + } + s += "\n" - s += "k/↑ up m set memo\n" - s += "j/↓ down esc/q back to stash\n" + s += "k/↑ up " + col1[0] + "\n" + s += "j/↓ down " + col1[1] + "\n" s += "b/pgup page up\n" s += "f/pgdn page down\n" s += "u ½ page up\n" |