From bc4b7cad68fb1d02bf749ad1403d76305906ae1a Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Fri, 11 Jan 2019 19:27:09 +0000 Subject: [PATCH] command/format: Render null in dark gray (#19616) --- command/format/diff.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/command/format/diff.go b/command/format/diff.go index 5b8847005..a7635e862 100644 --- a/command/format/diff.go +++ b/command/format/diff.go @@ -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 } @@ -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))