From b384fad0e0da245d348828d3c1bbf72717aceeff Mon Sep 17 00:00:00 2001 From: Lucy Dryaeva <48590492+ShadiestGoat@users.noreply.github.com> Date: Mon, 13 Apr 2026 02:36:55 +0100 Subject: [PATCH] fix: texinput: render full placeholder on 0 width --- textinput/textinput.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/textinput/textinput.go b/textinput/textinput.go index 363089b2..86b3a682 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -745,8 +745,14 @@ func (m Model) placeholderView() string { render = styles.Placeholder.Render ) - p := make([]rune, m.Width()+1) - copy(p, []rune(m.Placeholder)) + var p []rune + rawHolder := []rune(m.Placeholder) + if m.Width() <= 0 { + p = make([]rune, len(rawHolder)) + } else { + p = make([]rune, m.Width() + 1) + } + copy(p, rawHolder) m.virtualCursor.TextStyle = styles.Placeholder m.virtualCursor.SetChar(string(p[:1]))