mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
chore(textarea,textinput/lint): modernize loops
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user