@@ -175,21 +175,25 @@ func (m selectModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
175
175
}
176
176
177
177
func (m selectModel ) View () string {
178
- var s string
178
+ var s strings. Builder
179
179
180
180
msg := pretty .Sprintf (pretty .Bold (), "? %s" , m .message )
181
181
182
182
if m .selected != "" {
183
183
selected := pretty .Sprint (DefaultStyles .Keyword , m .selected )
184
- s += fmt .Sprintf ("%s %s\n " , msg , selected )
184
+ _ , _ = s . WriteString ( fmt .Sprintf ("%s %s\n " , msg , selected ) )
185
185
186
- return s
186
+ return s . String ()
187
187
}
188
188
189
189
if m .hideSearch {
190
- s += fmt .Sprintf ("%s [Use arrows to move]\n " , msg )
190
+ _ , _ = s . WriteString ( fmt .Sprintf ("%s [Use arrows to move]\n " , msg ) )
191
191
} else {
192
- s += fmt .Sprintf ("%s %s[Use arrows to move, type to filter]\n " , msg , m .search .View ())
192
+ _ , _ = s .WriteString (fmt .Sprintf (
193
+ "%s %s[Use arrows to move, type to filter]\n " ,
194
+ msg ,
195
+ m .search .View (),
196
+ ))
193
197
}
194
198
195
199
options , start := m .viewableOptions ()
@@ -204,11 +208,11 @@ func (m selectModel) View() string {
204
208
}
205
209
}
206
210
207
- s += pretty .Sprint (style , option )
208
- s += "\n "
211
+ _ , _ = s . WriteString ( pretty .Sprint (style , option ) )
212
+ _ , _ = s . WriteString ( "\n " )
209
213
}
210
214
211
- return s
215
+ return s . String ()
212
216
}
213
217
214
218
func (m selectModel ) viewableOptions () ([]string , int ) {
0 commit comments