diff --git a/textarea/textarea.go b/textarea/textarea.go index f56bc83..769becf 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -487,7 +487,7 @@ func (m *Model) insertRunesFromUserInput(runes []rune) { // Split the input into lines. var lines [][]rune lstart := 0 - for i := 0; i < len(runes); i++ { + for i := range runes { if runes[i] == '\n' { // Queue a line to become a new row in the text area below. // Beware to clamp the max capacity of the slice, to ensure no @@ -1375,7 +1375,7 @@ func (m Model) placeholderView() string { // split string by new lines plines := strings.Split(strings.TrimSpace(pwrap), "\n") - for i := 0; i < m.height; i++ { + for i := range m.height { isLineNumber := len(plines) > i lineStyle := styles.computedPlaceholder()