fix(textarea): apply prompt style on all lines, including fillers

If promptFunc was nil, promptView() woudl return a raw prompt without
styling, causing filler lines to not receive styling. This fixes the
behavior.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
This commit is contained in:
Christian Rocha
2026-07-04 07:39:48 -04:00
parent 0dafc720fa
commit d2b2217d63
+2 -5
View File
@@ -1377,7 +1377,6 @@ func (m *Model) view() string {
for wl, wrappedLine := range wrappedLines {
prompt := m.promptView(displayLine)
prompt = styles.computedPrompt().Render(prompt)
s.WriteString(style.Render(prompt))
displayLine++
@@ -1462,9 +1461,7 @@ func (m Model) View() string {
// promptView renders a single line of the prompt.
func (m Model) promptView(displayLine int) (prompt string) {
prompt = m.Prompt
if m.promptFunc == nil {
return prompt
}
if m.promptFunc != nil {
prompt = m.promptFunc(PromptInfo{
LineNumber: displayLine,
Focused: m.focus,
@@ -1473,6 +1470,7 @@ func (m Model) promptView(displayLine int) (prompt string) {
if width < m.promptWidth {
prompt = fmt.Sprintf("%*s%s", m.promptWidth-width, "", prompt)
}
}
return m.activeStyle().computedPrompt().Render(prompt)
}
@@ -1534,7 +1532,6 @@ func (m Model) placeholderView() string {
// render prompt
prompt := m.promptView(i)
prompt = styles.computedPrompt().Render(prompt)
s.WriteString(lineStyle.Render(prompt))
// when show line numbers enabled: