Skip to content

Commit 27912af

Browse files
authored
fix: render should open the viewer (#266)
1 parent ff9099b commit 27912af

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/runner/render/render.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ func (r *renderRunner) Exec(
9191

9292
ctx.Logger.Infof("Rendering content from file %s", contentFile)
9393
filename := filepath.Base(contentFile)
94+
95+
if err := ctx.TUIContainer.Start(); err != nil {
96+
return errors.Wrapf(err, "unable to open viewer")
97+
}
98+
defer func() {
99+
ctx.TUIContainer.WaitForExit()
100+
}()
101+
94102
ctx.TUIContainer.SetState("file", filename)
95103
return ctx.TUIContainer.SetView(views.NewMarkdownView(ctx.TUIContainer.RenderState(), buff.String()))
96104
}

0 commit comments

Comments
 (0)