From 05cef89fe4d9440eab32f539f0a9ae21cf125244 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Wed, 13 Nov 2024 13:05:52 -0600 Subject: [PATCH] fix(player): Fix help column alignment --- internal/player/keymap.go | 6 +++--- internal/player/player.go | 13 +------------ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/internal/player/keymap.go b/internal/player/keymap.go index a431aa5c..3847afd6 100644 --- a/internal/player/keymap.go +++ b/internal/player/keymap.go @@ -45,7 +45,7 @@ func newKeymap() keymap { ), chooseFull: key.NewBinding( key.WithKeys(" ", "enter"), - key.WithHelp("enter/space", "select"), + key.WithHelp("enter", "select"), ), jumps: jumps, jump: key.NewBinding( @@ -62,11 +62,11 @@ func newKeymap() keymap { ), stepPrev: key.NewBinding( key.WithKeys(","), - key.WithHelp(", (when paused)", "step backward"), + key.WithHelp(", (paused)", "step backward"), ), stepNext: key.NewBinding( key.WithKeys("."), - key.WithHelp(". (when paused)", "step forward"), + key.WithHelp(". (paused)", "step forward"), ), help: key.NewBinding( key.WithKeys("?"), diff --git a/internal/player/player.go b/internal/player/player.go index 3b500f76..439e3ef3 100644 --- a/internal/player/player.go +++ b/internal/player/player.go @@ -261,18 +261,7 @@ func (p *Player) OptionsView() string { } func (p *Player) HelpView() string { - v := p.help.View(p.keymap) - if p.help.ShowAll { - sep := p.help.Styles.FullSeparator.Render(p.help.FullSeparator) - sepSpaces := strings.Repeat(" ", lipgloss.Width(sep)) - // Remove first line separator - v = strings.Replace(v, sep+"\n", "\n", 1) - // Remove separator spaces form other lines - v = strings.ReplaceAll(v, sepSpaces+"\n", "\n") - // Remove separator spaces from final line - v = strings.TrimSuffix(v, sepSpaces) - } - return p.zone.Mark("help", v) + return p.zone.Mark("help", p.help.View(p.keymap)) } func (p *Player) pause() {