diff --git a/node.go b/node.go index b36ba47..3a0f739 100644 --- a/node.go +++ b/node.go @@ -73,6 +73,10 @@ func (s tableSite) isCell() bool { return s.table != nil && s.row != formatRow } +func (s tableSite) isFormat() bool { + return s.table != nil && s.row == formatRow +} + // label names the template at path in an error, a cell by its line in the rows file. func (s tableSite) label(path string) string { if s.isCell() { diff --git a/record.go b/record.go index 4d76149..3b001e7 100644 --- a/record.go +++ b/record.go @@ -263,7 +263,7 @@ func recordOf(n node) (*template, []Column, error) { // over sc's draws; a table's columns read the row pinned there. func renderRecord(s *generatorState, t *template, columns []Column, sc renderScope) *Record { sc = sc.in(t) - if t.site.row == formatRow { + if t.site.isFormat() { sc = sc.at(t.site.table.rowNode, &sc.groupDraws().pins) } r := &Record{columns: append([]Column(nil), columns...)} diff --git a/render.go b/render.go index abc02b6..9ef18d7 100644 --- a/render.go +++ b/render.go @@ -201,7 +201,7 @@ func traceRead(trace renderTrace, t *template, sc renderScope, a arm) { switch { case t.site.isCell(): row = renderedRow{t.site.table, t.site.row} - case t.site.row == formatRow: + case t.site.isFormat(): row = renderedRow{t.site.table, sc.rowOf(t.site.table)} } trace(strings.Clone(sc.group), row, a)