Skip to content

Commit 030d036

Browse files
committed
fix: preserve preview content on quit
Render the full view even when there's an error instead of short-circuiting, so content persists after ctrl+c.
1 parent a846395 commit 030d036

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/components/dev/view.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ var (
1616
)
1717

1818
func (m Model) View() string {
19-
if m.Err != nil {
20-
return m.Err.Error()
21-
}
22-
2319
s := strings.Builder{}
2420

2521
idx := slices.IndexFunc(parts, func(part ViewPart) bool {
@@ -30,6 +26,10 @@ func (m Model) View() string {
3026
parts[i].View(&m, &s)
3127
}
3228

29+
if m.Err != nil && m.Err != ErrUserCancelled {
30+
s.WriteString("\n" + m.Err.Error() + "\n")
31+
}
32+
3333
return s.String()
3434
}
3535

0 commit comments

Comments
 (0)