mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
fix: cursor actually need to take the renderer too
This commit is contained in:
+5
-3
@@ -75,12 +75,14 @@ type Model struct {
|
||||
}
|
||||
|
||||
// New creates a new model with default settings.
|
||||
func New() Model {
|
||||
func New(ctx *tea.Context) Model {
|
||||
return Model{
|
||||
BlinkSpeed: defaultBlinkSpeed,
|
||||
|
||||
Blink: true,
|
||||
mode: CursorBlink,
|
||||
Blink: true,
|
||||
mode: CursorBlink,
|
||||
TextStyle: ctx.Renderer.NewStyle(),
|
||||
Style: ctx.Renderer.NewStyle(),
|
||||
|
||||
blinkCtx: &blinkCtx{
|
||||
ctx: context.Background(),
|
||||
|
||||
@@ -249,7 +249,7 @@ type Model struct {
|
||||
func New(ctx *tea.Context) Model {
|
||||
vp := viewport.New(ctx, 0, 0)
|
||||
vp.KeyMap = viewport.KeyMap{}
|
||||
cur := cursor.New()
|
||||
cur := cursor.New(ctx)
|
||||
|
||||
focusedStyle, blurredStyle := DefaultStyles(ctx.Renderer)
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ func New(ctx *tea.Context) Model {
|
||||
PlaceholderStyle: r.NewStyle().Foreground(lipgloss.Color("240")),
|
||||
ShowSuggestions: false,
|
||||
CompletionStyle: r.NewStyle().Foreground(lipgloss.Color("240")),
|
||||
Cursor: cursor.New(),
|
||||
Cursor: cursor.New(ctx),
|
||||
KeyMap: DefaultKeyMap,
|
||||
|
||||
suggestions: [][]rune{},
|
||||
|
||||
Reference in New Issue
Block a user