mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-21 15:44:17 +02:00
Only show memo key in pager help for user stashed markdown
This commit is contained in:
parent
ac872bf41f
commit
dd8c650830
1 changed files with 14 additions and 5 deletions
19
ui/pager.go
19
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue