From b3f0c9e423182d999f2824f5ceb1b56c0ef08e1c Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 26 May 2025 09:08:32 -0400 Subject: [PATCH] fix(textarea): cursorline now fills the line when a placeholder is present --- textarea/textarea.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/textarea/textarea.go b/textarea/textarea.go index c88e92f..1fa63ce 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -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