@@ -26,7 +26,6 @@ type styledLine struct {
2626 text string
2727 highlight bool
2828 secondary bool
29- noIndent bool
3029}
3130
3231type App struct {
@@ -165,8 +164,7 @@ func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
165164 a .spinner , _ = a .spinner .Stop ()
166165 return a , nil
167166 case output.MessageEvent :
168- noIndent := msg .Severity == output .SeveritySuccess || msg .Severity == output .SeverityNote || msg .Severity == output .SeverityWarning
169- line := styledLine {text : components .RenderMessage (msg ), noIndent : noIndent }
167+ line := styledLine {text : components .RenderMessage (msg )}
170168 if a .spinner .PendingStop () {
171169 a .bufferedLines = append (a .bufferedLines , line )
172170 } else {
@@ -279,7 +277,6 @@ func formatResolvedInput(req output.UserInputRequestEvent, selectedKey string) s
279277 return fmt .Sprintf ("%s %s" , firstLine , selected )
280278}
281279
282- const lineIndent = 2
283280
284281
285282func isURL (s string ) bool {
@@ -297,39 +294,30 @@ func (a App) View() string {
297294 sb .WriteString ("\n " )
298295 }
299296
300- indent := strings .Repeat (" " , lineIndent )
301- contentWidth := a .width - lineIndent
302297 for _ , line := range a .lines {
303298 if line .highlight {
304299 if isURL (line .text ) {
305- wrapped := strings .Split (wrap .HardWrap (line .text , contentWidth ), "\n " )
300+ wrapped := strings .Split (wrap .HardWrap (line .text , a . width ), "\n " )
306301 var styledParts []string
307302 for _ , part := range wrapped {
308303 styledParts = append (styledParts , styles .Link .Render (part ))
309304 }
310- sb .WriteString (indent )
311- sb .WriteString (hyperlink (line .text , strings .Join (styledParts , "\n " + indent )))
305+ sb .WriteString (hyperlink (line .text , strings .Join (styledParts , "\n " )))
312306 } else {
313- sb .WriteString (indent )
314- sb .WriteString (styles .Highlight .Render (wrap .HardWrap (line .text , contentWidth )))
307+ sb .WriteString (styles .Highlight .Render (wrap .HardWrap (line .text , a .width )))
315308 }
316309 sb .WriteString ("\n \n " )
317310 continue
318311 } else if line .secondary {
319312 if strings .HasPrefix (line .text , ">" ) {
320- sb .WriteString (styles .SecondaryMessage .Render (wrap .HardWrap (line .text , contentWidth )))
313+ sb .WriteString (styles .SecondaryMessage .Render (wrap .HardWrap (line .text , a . width )))
321314 sb .WriteString ("\n \n " )
322315 continue
323316 }
324- sb .WriteString (indent )
325- text := wrap .HardWrap (line .text , contentWidth )
326- sb .WriteString (styles .SecondaryMessage .Render (text ))
327- } else if line .noIndent {
328317 text := wrap .HardWrap (line .text , a .width )
329- sb .WriteString (text )
318+ sb .WriteString (styles . SecondaryMessage . Render ( text ) )
330319 } else {
331- sb .WriteString (indent )
332- text := wrap .HardWrap (line .text , contentWidth )
320+ text := wrap .HardWrap (line .text , a .width )
333321 sb .WriteString (text )
334322 }
335323 sb .WriteString ("\n " )
@@ -347,7 +335,7 @@ func (a App) View() string {
347335 sb .WriteString ("\n " )
348336 }
349337
350- if errorView := a .errorDisplay .View (contentWidth ); errorView != "" {
338+ if errorView := a .errorDisplay .View (a . width ); errorView != "" {
351339 sb .WriteString (errorView )
352340 }
353341
0 commit comments