styled placeholders
Opened this issue · 2 comments
simonasGit commented
m.input.SetValue(lipgloss.NewStyle().
Background(lipgloss.Color("#00ff00")).
Render("hah"))
Instead of using textinput.Model.TextStyle
to style the whole text, one may want to only style certain words for example.
I think it might be in styleText because escape sequences are being applied to a lipgloss styled string.
- OS [Arch]
- Shell [zsh, fish]
- Terminal Emulator [Alacritty]
meowgorithm commented
Thanks for the issue! So as a baseline, we should definitely strip ansi from placeholders. Then the question becomes: should we allow placeholders to be styled as well? I think so.
simonasGit commented
Yeah I guess if PlaceholderStyle and TextStyle are deprecated, if one wants a style for the whole string - m.ti.Placeholder = style.Render(text)
or
func (m model) View() string {
v := style.Render(m.ti.Value())
m.ti.SetValue(v)
return m.ti.View()
}