chore(textarea,cursor): flesh out real cursor API

This commit is contained in:
Christian Rocha
2025-01-31 16:21:17 -05:00
parent a0d9fe396d
commit 9d5d140b3c
3 changed files with 92 additions and 35 deletions
+2 -2
View File
@@ -671,7 +671,7 @@ func (m Model) View() string {
if m.canAcceptSuggestion() {
suggestion := m.matchedSuggestions[m.currentSuggestionIndex]
if len(value) < len(suggestion) {
m.Cursor.TextStyle = m.CompletionStyle
m.Cursor.BlinkedStyle = m.CompletionStyle
m.Cursor.SetChar(m.echoTransform(string(suggestion[pos])))
v += m.Cursor.View()
v += m.completionView(1)
@@ -709,7 +709,7 @@ func (m Model) placeholderView() string {
p := make([]rune, m.Width()+1)
copy(p, []rune(m.Placeholder))
m.Cursor.TextStyle = m.PlaceholderStyle
m.Cursor.BlinkedStyle = m.PlaceholderStyle
m.Cursor.SetChar(string(p[:1]))
v += m.Cursor.View()