From 4da03b3c338a04dd67ca192209419d8b3279caed Mon Sep 17 00:00:00 2001 From: RoomWithOutRoof Date: Wed, 15 Apr 2026 00:12:10 +0800 Subject: [PATCH] fix textinput: render full placeholder text Previously, the placeholder would only display the first character when Width() was small or unset. This was caused by allocating a rune slice with size m.Width()+1, which would truncate the placeholder text. Now we allocate the full placeholder text and display it properly regardless of the Width() setting. Fixes charmbracelet/bubbles#779 --- textinput/textinput.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/textinput/textinput.go b/textinput/textinput.go index 363089b2..a195e696 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -745,8 +745,7 @@ func (m Model) placeholderView() string { render = styles.Placeholder.Render ) - p := make([]rune, m.Width()+1) - copy(p, []rune(m.Placeholder)) + p := []rune(m.Placeholder) m.virtualCursor.TextStyle = styles.Placeholder m.virtualCursor.SetChar(string(p[:1]))