mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-03-14 13:03:44 +03:00
Simplify code
This commit is contained in:
parent
5dd3605496
commit
ec0559f2d5
@ -37,10 +37,7 @@ type Model struct {
|
|||||||
|
|
||||||
// Focused returns the focus state on the model
|
// Focused returns the focus state on the model
|
||||||
func (m Model) Focused() bool {
|
func (m Model) Focused() bool {
|
||||||
if m.focus {
|
return m.focus
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Focus sets the focus state on the model
|
// Focus sets the focus state on the model
|
||||||
@ -206,13 +203,13 @@ func placeholderView(m Model) string {
|
|||||||
func cursorView(s string, m Model) string {
|
func cursorView(s string, m Model) string {
|
||||||
if m.blink {
|
if m.blink {
|
||||||
return s
|
return s
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return termenv.String(s).
|
return termenv.String(s).
|
||||||
Foreground(color(m.CursorColor)).
|
Foreground(color(m.CursorColor)).
|
||||||
Reverse().
|
Reverse().
|
||||||
String()
|
String()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Subscription
|
// Subscription
|
||||||
func Blink(model tea.Model) tea.Msg {
|
func Blink(model tea.Model) tea.Msg {
|
||||||
|
Loading…
Reference in New Issue
Block a user