Skip to content

Commit

Permalink
fix: comp
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Sep 12, 2024
1 parent 987ee1e commit f228fbf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,10 @@ func (m Model) View() string {
} else {
m.Cursor.SetChar(string(wrappedLine[lineInfo.ColumnOffset]))
if m.canAcceptSuggestion() && len(m.matchedSuggestions) > 0 {
suggestion := m.matchedSuggestions[m.currentSuggestionIndex][m.row:]
suggestion := m.matchedSuggestions[m.currentSuggestionIndex]
if len(suggestion) >= m.row {
suggestion = suggestion[m.row:]
}
m.Cursor.TextStyle = m.style.Placeholder
if len(suggestion) > m.row && len(suggestion[m.row]) > m.col {
m.Cursor.SetChar(string(suggestion[m.row][m.col]))
Expand Down

0 comments on commit f228fbf

Please sign in to comment.