diff --git a/file.go b/file.go index 900c445..0843510 100644 --- a/file.go +++ b/file.go @@ -68,6 +68,15 @@ func (nptf *notPlainTextFlag) Type() string { return "short|full|skip" // ??? } +var ( + // printedFull is set by file() if it prints a full file's matches + // (i.e. a header line, then the match lines). It is cleared if we + // just printed a "Binary file matches" line. It lets us have a + // nice one-line separator between full files, but show the binary + // matches compactly. + printedFull bool +) + func file(path string, data []byte) { var short string isBinary, isMinified := notPlainText(data) diff --git a/main.go b/main.go index 4390727..7534413 100644 --- a/main.go +++ b/main.go @@ -63,7 +63,6 @@ var ( ignoreCase bool noColour bool display *Display - printedFull bool ) func init() {