From 4755f88132b105b972137df6159b5e2306592dd0 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 12 Sep 2024 09:26:48 -0300 Subject: [PATCH] fix: comp --- textarea/textarea.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/textarea/textarea.go b/textarea/textarea.go index 9a817bb..4f69faf 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -1268,7 +1268,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]))