Skip to content

Commit f53b3d9

Browse files
lc-1010meowgorithm
authored andcommitted
fix: Unicode character encoding error
1 parent 540c8ac commit f53b3d9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

textinput/textinput.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,16 +705,16 @@ func (m Model) View() string {
705705
func (m Model) placeholderView() string {
706706
var (
707707
v string
708-
p = m.Placeholder
708+
p = []rune(m.Placeholder)
709709
style = m.PlaceholderStyle.Inline(true).Render
710710
)
711711

712712
m.Cursor.TextStyle = m.PlaceholderStyle
713-
m.Cursor.SetChar(p[:1])
713+
m.Cursor.SetChar(string(p[:1]))
714714
v += m.Cursor.View()
715715

716716
// The rest of the placeholder text
717-
v += style(p[1:])
717+
v += style(string(p[1:]))
718718

719719
return m.PromptStyle.Render(m.Prompt) + v
720720
}

0 commit comments

Comments
 (0)