From c4fb002ae0b48aed1a0d2b8fa84b6be795f83e2d Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 24 Nov 2024 14:26:28 -0500 Subject: feat: Update master (#7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Attemp at using goreleaser * Fix syntax error in .goreleaser.yml * fix: Check roadmap feature for clipboard (README) * feat: add help menu at the bottom (#4) * MVP for a help menu * fix: commented code is evil * feat: box-drawing UI (#6) * feat: add help at the bottom (#5) * Attemp at using goreleaser * Fix syntax error in .goreleaser.yml * fix: Check roadmap feature for clipboard (README) * feat: add help menu at the bottom (#4) * MVP for a help menu * fix: commented code is evil * Update generated VHS GIF * feat: Rounded corner box UI * Update roadmap checkmarks in README --------- Co-authored-by: vhs-action 📼 --------- Co-authored-by: vhs-action 📼 --- internal/picker/picker.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'internal/picker/picker.go') diff --git a/internal/picker/picker.go b/internal/picker/picker.go index 14ada59..5a7493d 100644 --- a/internal/picker/picker.go +++ b/internal/picker/picker.go @@ -9,6 +9,10 @@ import ( tea "github.com/charmbracelet/bubbletea" ) +const ( + activeRune = '>' +) + type Model struct { title string active int @@ -109,11 +113,16 @@ func (m Model) Init() tea.Cmd { func (m Model) View() string { var s string + + carriageReturn := "" for i, slider := range m.sliders { + if i > 0 { + carriageReturn = "\n" + } if i == m.active { - s += fmt.Sprintf("\n-> %s", slider.View()) + s += fmt.Sprintf("%v%c %s", carriageReturn, activeRune, slider.View()) } else { - s += fmt.Sprintf("\n %s", slider.View()) + s += fmt.Sprintf("%v %s", carriageReturn, slider.View()) } } return s -- cgit v1.2.3