terraform/command/format
Alisdair McDiarmid a23c3e3c81 command/format: Fix multi-line diagnostic output
Previously, if a diagnostic context spanned multiple lines, any lines
which did not overlap with the highlight range would be displayed as
blank. This commit fixes the bug.

The problem was caused by the unconditional use of `PartitionAround` to
split the line into before/highlighted/after ranges. When two ranges
don't overlap, this method returns empty ranges, which results in a
blank line. Instead, we first check if the ranges do overlap, and if not
we print the entire line from the context.
2020-03-26 15:53:52 -04:00
..
diagnostic.go command/format: Fix multi-line diagnostic output 2020-03-26 15:53:52 -04:00
diagnostic_test.go command/format: Fix multi-line diagnostic output 2020-03-26 15:53:52 -04:00
diff.go Don't inspect an empty set, return false 2019-12-05 16:00:19 -05:00
diff_test.go finish provider ModuleInstance replacement 2020-03-11 14:19:52 -04:00
format.go command/format: a package for formatting plans/state for output 2017-01-26 14:33:49 -08:00
object_id.go command: Reinstate object ids in the UIHook progress logs 2018-10-16 19:14:11 -07:00
object_id_test.go Updates after running `make fmt` with Go v1.11.1 2018-10-17 14:11:08 -07:00
state.go fixup states.Resource change throughout packages 2020-03-16 16:50:48 -04:00
state_test.go finish provider ModuleInstance replacement 2020-03-11 14:19:52 -04:00