summaryrefslogtreecommitdiff
path: root/internal/picker/picker.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/picker/picker.go')
-rw-r--r--internal/picker/picker.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/internal/picker/picker.go b/internal/picker/picker.go
index 5a7493d..3094396 100644
--- a/internal/picker/picker.go
+++ b/internal/picker/picker.go
@@ -5,14 +5,11 @@ import (
"github.com/ChausseBenjamin/termpicker/internal/colors"
"github.com/ChausseBenjamin/termpicker/internal/slider"
+ "github.com/ChausseBenjamin/termpicker/internal/ui"
"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
)
-const (
- activeRune = '>'
-)
-
type Model struct {
title string
active int
@@ -114,15 +111,19 @@ func (m Model) Init() tea.Cmd {
func (m Model) View() string {
var s string
- carriageReturn := ""
+ newline := ""
for i, slider := range m.sliders {
if i > 0 {
- carriageReturn = "\n"
+ newline = "\n"
}
if i == m.active {
- s += fmt.Sprintf("%v%c %s", carriageReturn, activeRune, slider.View())
+ s += fmt.Sprintf("%v%s %s",
+ newline,
+ ui.Style().PickerCursor.Render(ui.PickerSelRune),
+ slider.View(),
+ )
} else {
- s += fmt.Sprintf("%v %s", carriageReturn, slider.View())
+ s += fmt.Sprintf("%v %s", newline, slider.View())
}
}
return s