Merge remote-tracking branch 'origin/master' into v2-exp

This commit is contained in:
Carlos Alexandro Becker
2025-01-14 14:22:36 -03:00
9 changed files with 506 additions and 10 deletions
+3 -1
View File
@@ -703,10 +703,12 @@ func (m Model) View() string {
func (m Model) placeholderView() string {
var (
v string
p = []rune(m.Placeholder)
style = m.PlaceholderStyle.Inline(true).Render
)
p := make([]rune, m.Width+1)
copy(p, []rune(m.Placeholder))
m.Cursor.TextStyle = m.PlaceholderStyle
m.Cursor.SetChar(string(p[:1]))
v += m.Cursor.View()
+7
View File
@@ -30,3 +30,10 @@ func Test_CurrentSuggestion(t *testing.T) {
t.Fatalf("Error: expected first suggestion but was %s", suggestion)
}
}
func Test_SlicingOutsideCap(t *testing.T) {
textinput := New()
textinput.Placeholder = "作業ディレクトリを指定してください"
textinput.Width = 32
textinput.View()
}