Skip to content

Commit

Permalink
command/format: Render null in dark gray (#19616)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Jan 11, 2019
1 parent c5ea0f7 commit bc4b7ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions command/format/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func (p *blockBodyDiffPrinter) writeValue(val cty.Value, action plans.Action, in
return
}
if val.IsNull() {
p.buf.WriteString("null")
p.buf.WriteString(p.color.Color("[dark_gray]null[reset]"))
return
}

Expand Down Expand Up @@ -815,7 +815,11 @@ func (p *blockBodyDiffPrinter) writeValueDiff(old, new cty.Value, indent int, pa

// In all other cases, we just show the new and old values as-is
p.writeValue(old, plans.Delete, indent)
p.buf.WriteString(p.color.Color(" [yellow]->[reset] "))
if new.IsNull() {
p.buf.WriteString(p.color.Color(" [dark_gray]->[reset] "))
} else {
p.buf.WriteString(p.color.Color(" [yellow]->[reset] "))
}
p.writeValue(new, plans.Create, indent)
if p.pathForcesNewResource(path) {
p.buf.WriteString(p.color.Color(forcesNewResourceCaption))
Expand Down

0 comments on commit bc4b7ca

Please sign in to comment.