File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ func NewInputWidgetDemo() *InputWidgetDemo {
2424 s := new (InputWidgetDemo )
2525
2626 s .tiDemo = textinput .New ()
27- s .tiDemo .Prompt = ">"
27+ s .tiDemo .Prompt = "> "
2828 s .tiDemo .Placeholder = "Amazing placeholder"
2929 //s.tiDemo.Placeholder = "Placeholder"
3030
Original file line number Diff line number Diff line change @@ -72,8 +72,10 @@ func (w *Widget) Resize(size orvyn.Size) {
7272 w .Model .Width = contentSize .Width
7373
7474 if len (w .Model .Value ()) > 0 || len (w .Model .Placeholder ) == 0 {
75- w .Model .Width --
76- w .Model .Width -= len (w .Model .Prompt )
75+ // Bubbles' View() always renders the cursor as one extra column past
76+ // the value, so reserve 1 column on top of the prompt width. Without
77+ // the constant -1 the box grows by one column once a value is typed.
78+ w .Model .Width -= 1 + len (w .Model .Prompt )
7779 }
7880
7981 // For the Bubbles textinput to process the update
You can’t perform that action at this time.
0 commit comments