command/format: correct alignment for multi-line values in map diff

This commit is contained in:
Martin Atkins 2018-08-29 18:54:56 -07:00
parent 20318ca193
commit 9706a00b3a
1 changed files with 3 additions and 3 deletions

View File

@ -703,15 +703,15 @@ func (p *blockBodyDiffPrinter) writeValueDiff(old, new cty.Value, indent int, pa
switch action {
case plans.Create, plans.NoOp:
v := new.Index(kV)
p.writeValue(v, action, 0)
p.writeValue(v, action, indent+4)
case plans.Delete:
oldV := old.Index(kV)
newV := cty.NullVal(oldV.Type())
p.writeValueDiff(oldV, newV, 0, path)
p.writeValueDiff(oldV, newV, indent+4, path)
default:
oldV := old.Index(kV)
newV := new.Index(kV)
p.writeValueDiff(oldV, newV, 0, path)
p.writeValueDiff(oldV, newV, indent+4, path)
}
p.buf.WriteString(",\n")