From f53b3d9f617a3c4242b71cb0f7f95b3245b0ed65 Mon Sep 17 00:00:00 2001 From: lc-1010 <532398960@qq.com> Date: Wed, 27 Sep 2023 12:42:04 +0800 Subject: [PATCH] fix: Unicode character encoding error --- textinput/textinput.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/textinput/textinput.go b/textinput/textinput.go index 82341b9..964d28f 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -705,16 +705,16 @@ func (m Model) View() string { func (m Model) placeholderView() string { var ( v string - p = m.Placeholder + p = []rune(m.Placeholder) style = m.PlaceholderStyle.Inline(true).Render ) m.Cursor.TextStyle = m.PlaceholderStyle - m.Cursor.SetChar(p[:1]) + m.Cursor.SetChar(string(p[:1])) v += m.Cursor.View() // The rest of the placeholder text - v += style(p[1:]) + v += style(string(p[1:])) return m.PromptStyle.Render(m.Prompt) + v }