fix(textarea): cursorline now fills the line when a placeholder is present

This commit is contained in:
Christian Rocha
2025-05-26 09:15:38 -04:00
parent e89dc94c85
commit b3f0c9e423
+5
View File
@@ -1418,6 +1418,11 @@ func (m Model) placeholderView() string {
// the rest of the first line
s.WriteString(lineStyle.Render(styles.computedPlaceholder().Render(rest)))
// extend the first line with spaces to fill the width, so that
// the entire line is filled when cursorline is enabled.
gap := strings.Repeat(" ", max(0, m.width-lipgloss.Width(plines[0])))
s.WriteString(lineStyle.Render(gap))
// remaining lines
case len(plines) > i:
// current line placeholder text