Skip to content

Commit

Permalink
wip: margins
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Oct 11, 2023
1 parent 3d02974 commit e4b6e00
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ansi/blockelement.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,21 @@ type BlockElement struct {
func (e *BlockElement) Render(w io.Writer, ctx RenderContext) error {
bs := ctx.blockStack
bs.Push(*e)

// TODO handle prefix for blocks
return nil
}

// setMargins sets the margins given the prefix and suffix values being non-nil.

func (e *BlockElement) Finish(w io.Writer, ctx RenderContext) error {
bs := ctx.blockStack
blockBuffer := bs.Current().Block
ls := e.Style.Style()

_, err := w.Write([]byte(e.Style.Style().Render(blockBuffer.String())))
_, err := w.Write([]byte(ls.Render(blockBuffer.String())))
if err != nil {
return err
}

// TODO handle suffix for blocks

blockBuffer.Reset()
bs.Pop()
return nil
Expand Down

0 comments on commit e4b6e00

Please sign in to comment.